diff --git a/.circleci/config.yml b/.circleci/config.yml index 25837ebca..5601bf89f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,10 @@ version: 2 jobs: test: - working_directory: /go/src/github.com/runatlantis/atlantis docker: - image: runatlantis/testing-env:latest + environment: + GOFLAGS: "-mod=vendor" steps: - checkout - run: make test-coverage @@ -13,7 +14,6 @@ jobs: - run: make check-fmt - run: make check-lint e2e: - working_directory: /go/src/github.com/runatlantis/atlantis docker: - image: circleci/golang:1.12 environment: @@ -22,6 +22,7 @@ jobs: # that flag starts the download asynchronously so we'd have a race # condition. TERRAFORM_VERSION: 0.12.7 + GOFLAGS: "-mod=vendor" steps: - checkout - run: make build-service @@ -53,9 +54,10 @@ jobs: # Build and push 'latest' Docker tag. docker_master: - working_directory: /go/src/github.com/runatlantis/atlantis docker: - image: circleci/golang:1.12 + environment: + GOFLAGS: "-mod=vendor" steps: - checkout - run: make build-service @@ -75,9 +77,10 @@ jobs: fi # Build and push Docker tag. docker_tag: - working_directory: /go/src/github.com/runatlantis/atlantis docker: - image: circleci/golang:1.12 + environment: + GOFLAGS: "-mod=vendor" steps: - checkout - run: make build-service diff --git a/Makefile b/Makefile index a7d10068c..05a8575c7 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,6 @@ check-lint: ## Run linter in CI/CD. If running locally use 'lint' ./bin/golangci-lint run check-fmt: ## Fail if not formatted - go get golang.org/x/tools/cmd/goimports if [[ $$(goimports -l $$(find . -type f -name '*.go' ! -path "./vendor/*" ! -path "./server/static/bindata_assetfs.go" ! -path "**/mocks/*")) ]]; then exit 1; fi end-to-end-deps: ## Install e2e dependencies diff --git a/testing/Dockerfile b/testing/Dockerfile index d860ca718..9c84361e4 100644 --- a/testing/Dockerfile +++ b/testing/Dockerfile @@ -11,3 +11,4 @@ RUN curl -LOks https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/ter sudo unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin/tf/versions/${TERRAFORM_VERSION} && \ sudo ln -s /usr/local/bin/tf/versions/${TERRAFORM_VERSION}/terraform /usr/local/bin/terraform && \ rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip +RUN go get golang.org/x/tools/cmd/goimports