forked from codegram/decidim-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
40 lines (40 loc) · 1.4 KB
/
circle.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
version: 2
jobs:
build:
working_directory: /app
docker:
- image: docker:17.09.0-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Login to docker
command: |
docker login --username=_ --password=$HEROKU_AUTH_TOKEN registry.heroku.com
docker login --username=$DOCKER_USER --password=$DOCKER_PASS
- run:
name: Pulling docker image
command: |
docker pull decidim/decidim-monitor || true
docker pull registry.heroku.com/decidim-monitor/web || true
- run:
name: Build image
command: |
docker build -t registry.heroku.com/decidim-monitor/web -t decidim/decidim-monitor:latest --cache-from registry.heroku.com/decidim-monitor/web .
- run:
name: Run tests
command: |
docker build -t decidim-monitor:ci -f Dockerfile.ci --build-arg FROM=decidim/decidim-monitor:latest .
docker run -it decidim-monitor:ci
- run:
name: Push deployment image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker push registry.heroku.com/decidim-monitor/web
fi
- run:
name: Push docker hub image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker push decidim/decidim-monitor:latest
fi