Skip to content

Commit

Permalink
e2e image and testing fixes (#2672)
Browse files Browse the repository at this point in the history
* build testing-env-image in relevant PRs

* hadolint testing/Dockerfile and rm go get

* revert cimg/go back to circleci/golang image
  • Loading branch information
nitrocode authored Nov 13, 2022
1 parent 7f75002 commit 62719ee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
- run: make check-lint
e2e:
docker:
- image: cimg/go:1.19 # If you update this, update it in the Makefile too
# TODO: use image: cimg/go:1.19
- image: circleci/golang:1.19 # If you update this, update it in the Makefile too
environment:
# This version of TF will be downloaded before Atlantis is started.
# We do this instead of setting --default-tf-version because setting
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/testing-env-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- ".github/workflows/testing-env-image.yml"
branches:
- "master"
pull_request:
paths:
- 'testing/**'
- '.github/workflows/testing-env-image.yml'
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -41,7 +45,7 @@ jobs:
with:
context: testing
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/runatlantis/testing-env:${{env.TODAY}}
ghcr.io/runatlantis/testing-env:latest
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dist: ## Package up everything in static/ using go-bindata-assetfs so it can be
rm -f server/static/bindata_assetfs.go && go-bindata-assetfs -o bindata_assetfs.go -pkg static -prefix server server/static/... && mv bindata_assetfs.go server/static

release: ## Create packages for a release
docker run -v $$(pwd):/go/src/github.com/runatlantis/atlantis cimg/go:1.19 sh -c 'cd /go/src/github.com/runatlantis/atlantis && scripts/binary-release.sh'
docker run -v $$(pwd):/go/src/github.com/runatlantis/atlantis circleci/golang:1.19 sh -c 'cd /go/src/github.com/runatlantis/atlantis && scripts/binary-release.sh'

fmt: ## Run goimports (which also formats)
goimports -w $$(find . -type f -name '*.go' ! -path "./vendor/*" ! -path "./server/static/bindata_assetfs.go" ! -path "**/mocks/*")
Expand Down
7 changes: 4 additions & 3 deletions testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM golang:1.19

RUN apt-get update && apt-get install unzip
RUN apt-get update && apt-get --no-install-recommends -y install unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install Terraform
ENV TERRAFORM_VERSION=1.3.4
Expand All @@ -13,6 +15,7 @@ RUN case $(uname -m) in x86_64|amd64) ARCH="amd64" ;; aarch64|arm64|armv7l) ARCH

# Install conftest
ENV CONFTEST_VERSION=0.35.0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN case $(uname -m) in x86_64|amd64) ARCH="x86_64" ;; aarch64|arm64|armv7l) ARCH="arm64" ;; esac && \
curl -LOs https://github.com/open-policy-agent/conftest/releases/download/v${CONFTEST_VERSION}/conftest_${CONFTEST_VERSION}_Linux_${ARCH}.tar.gz && \
curl -LOs https://github.com/open-policy-agent/conftest/releases/download/v${CONFTEST_VERSION}/checksums.txt && \
Expand All @@ -22,5 +25,3 @@ RUN case $(uname -m) in x86_64|amd64) ARCH="x86_64" ;; aarch64|arm64|armv7l) ARC
ln -s /usr/local/bin/cft/versions/${CONFTEST_VERSION}/conftest /usr/local/bin/conftest${CONFTEST_VERSION} && \
rm conftest_${CONFTEST_VERSION}_Linux_${ARCH}.tar.gz && \
rm checksums.txt

RUN go get golang.org/x/tools/cmd/goimports

0 comments on commit 62719ee

Please sign in to comment.