Skip to content

Commit

Permalink
workflow: add testing-env image build/publish process (#1780)
Browse files Browse the repository at this point in the history
* workflow: add testing-env image build/publish process

replacing https://hub.docker.com/r/runatlantis/testing-env

Signed-off-by: Rui Chen <[email protected]>

* refresh the testing-env image

* only runs on master branch

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 authored Aug 31, 2021
1 parent f2ded06 commit ffda290
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test:
docker:
- image: ghcr.io/runatlantis/testing-env:805e94e7f648eddb0484e539a7b51410d39529bc
- image: ghcr.io/runatlantis/testing-env:2021.08.31
steps:
- checkout
- run: make test-all
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ jobs:
test:
name: runner / gotest
runs-on: ubuntu-latest
container: ghcr.io/runatlantis/testing-env:805e94e7f648eddb0484e539a7b51410d39529bc
container: ghcr.io/runatlantis/testing-env:2021.08.31
steps:
# user in image needs write access to do anything
- name: setup
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
- uses: actions/checkout@v2
- run: make test-all
- run: make test-all
35 changes: 35 additions & 0 deletions .github/workflows/testing-env-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: testing-env-image

on:
push:
paths:
- ./testing/**
- .github/workflows/testing-env-image.yml
branches:
- "master"
workflow_dispatch:

defaults:
run:
working-directory: testing

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
- name: build testing-env:${{env.TODAY}} image
run: |
docker build -t ghcr.io/runatlantis/testing-env:${{env.TODAY}} .
- name: publish testing-env:${{env.TODAY}} image
run: |
docker push ghcr.io/runatlantis/testing-env:${{env.TODAY}}
docker tag ghcr.io/runatlantis/testing-env:${{env.TODAY}} ghcr.io/runatlantis/testing-env:latest
docker push ghcr.io/runatlantis/testing-env:latest
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ docker-compose up --detach --build
## Running Tests In Docker:
```
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis runatlantis/testing-env make test
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis ghcr.io/runatlantis/testing-env:latest make test
```
Or to run the integration tests
```
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis runatlantis/testing-env make test-all
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis ghcr.io/runatlantis/testing-env:latest make test-all
```
## Calling Your Local Atlantis From GitHub
Expand Down

0 comments on commit ffda290

Please sign in to comment.