-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathconfig.yml
60 lines (60 loc) · 2.25 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: 2
jobs:
build:
working_directory: /go/src/github.com/hootsuite/atlantis
docker:
- image: circleci/golang:1.9.2
environment:
TERRAFORM_VERSION: 0.10.8
steps:
- checkout
- setup_remote_docker:
reusable: true
- run: make test-coverage
- run: make check-fmt
- run: make check-gometalint
- run:
name: post coverage to codecov.io
command: bash <(curl -s https://codecov.io/bash)
- run: make build-service
- run:
name: Install e2e dependencies
command: make end-to-end-deps
- run:
name: Starting atlantis server in the background
command: cd "${CIRCLE_WORKING_DIRECTORY}/e2e" && ./atlantis server --gh-user="$GITHUB_USERNAME" --gh-token="$GITHUB_PASSWORD" --data-dir="/tmp" --log-level="debug" &> /tmp/atlantis-server.log
background: true
- run: sleep 2
- run:
name: Starting ngrok
command: cd "${CIRCLE_WORKING_DIRECTORY}/e2e" && ./ngrok http 4141 > /tmp/ngrok.log
background: true
- run: sleep 2
- run: echo "export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[] | select(.proto=="http") | .public_url')" >> $BASH_ENV
- run:
name: Run e2e tests
command: make end-to-end-tests
- run:
name: Build image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker build -t hootsuite/atlantis:latest .
fi
- run:
name: Push image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
docker push hootsuite/atlantis:latest
fi
- run:
name: Tag and push version if exists
# work around until tags are properly supported
# https://discuss.circleci.com/t/git-tag-deploys-in-2-0/9493/6
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
for TAG in $(git tag --contains $CIRCLE_SHA1); do
docker tag hootsuite/atlantis:latest hootsuite/atlantis:$TAG
docker push hootsuite/atlantis:$TAG
done
fi