Skip to content

Commit 2653f9f

Browse files
committed
Build, tag and push images via CI
[refs #a604d5dbc223]
1 parent e70e6d7 commit 2653f9f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@ jobs:
2121
- run:
2222
name: Running the test suite
2323
command: ./scripts/run-specs.sh
24+
- run:
25+
name: Signing in to Docker Hub
26+
command: docker login -u $DOCKER_USER -p $DOCKER_PASS
27+
- run:
28+
name: Building and pushing images
29+
command: |
30+
set -e
31+
export COMPOSE_FILE=docker-compose.build.yml
32+
export GIT_SHA=`git rev-parse HEAD`
33+
docker-compose build --pull
34+
docker-compose push
2435
- store_artifacts:
2536
path: /tmp/artifacts

docker-compose.build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: '3.3'
2+
3+
services:
4+
current:
5+
image: jfahrer/demo_web_app:${GIT_SHA}
6+
build:
7+
context: .
8+
args:
9+
PREPARE_DATABASE: "true"
10+
WAIT_FOR_POSTGRES: "false"
11+
12+
latest:
13+
image: jfahrer/demo_web_app:latest
14+
build:
15+
context: .
16+
args:
17+
PREPARE_DATABASE: "true"
18+
WAIT_FOR_POSTGRES: "false"
19+
20+
wait_for_pg:
21+
image: jfahrer/demo_web_app:wait_for_pg
22+
build:
23+
context: .
24+
args:
25+
PREPARE_DATABASE: "true"
26+
WAIT_FOR_POSTGRES: "true"
27+

0 commit comments

Comments
 (0)