Files
ent/.circleci/config.yml
Alex Snast 06040fae1e ent/circleci: hide cloudfront distribution id echoed by create-invalidation command (#26)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/26

Example output:
```
> aws cloudfront create-invalidation --distribution-id $CDN_DISTRIBUTION_ID --paths "/*" | jq -M "del(.Location)"                                                                      alexsn@Titan
{
  "Invalidation": {
    "Id": "IXPTPF87PGPXA",
    "Status": "InProgress",
    "CreateTime": "2019-08-25T11:06:53.442Z",
    "InvalidationBatch": {
      "Paths": {
        "Quantity": 1,
        "Items": [
          "/*"
        ]
      },
      "CallerReference": "cli-1566731212-457274"
    }
  }
}
```

Reviewed By: a8m

Differential Revision: D17046012

fbshipit-source-id: a135e9d1cb106af298515b7caafc4a8b1ff6e291
2019-08-25 04:50:15 -07:00

87 lines
2.1 KiB
YAML

version: 2.1
orbs:
aws-cli: circleci/aws-cli@0.1.13
jobs:
unit:
docker:
- image: circleci/golang
working_directory: /go/src/github.com/facebookincubator/ent
steps:
- run:
name: Install goimports
command: go get -u golang.org/x/tools/cmd/goimports
- checkout
- run:
name: Dialect tests
command: go test -v ./dialect/...
- run:
name: Schema tests
command: go test -v ./schema/...
- run:
name: Loader tests
command: go test -v ./entc/load/...
- run:
name: Codegen tests
command: go test -v ./entc/gen/...
integration:
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Spin up databases
command: |
cd entc/integration/compose
docker-compose up -d --scale test=0
- run:
name: Run integration tests
command: |
cd entc/integration/compose
docker-compose run test go test ./entc/integration/...
docs:
docker:
- image: circleci/node
steps:
- checkout
- run:
name: Checking Docs Modified
command: |
if [[ ! $(git diff master^ --name-only doc/) ]]; then
echo "docs not modified; no need to deploy"
circleci step halt
fi
- run:
name: Install Dependencies
working_directory: ~/project/doc/website
command: yarn
- run:
name: Build Docs
working_directory: ~/project/doc/website
command: yarn build
- aws-cli/install
- aws-cli/configure
- run:
name: Deploy Docs
working_directory: ~/project/doc/website/build/ent
command: aws s3 sync . s3://entgo.io --delete --exclude "assets/*"
- run:
name: Invalidate Cache
command: aws cloudfront create-invalidation --distribution-id $CDN_DISTRIBUTION_ID --paths "/*" | jq -M "del(.Location)"
workflows:
version: 2.1
all:
jobs:
- unit
- integration:
requires:
- unit
- docs:
requires:
- integration
filters:
branches:
only: master