forked from mozilla/fxa-auth-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
49 lines (45 loc) · 1.54 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
41
42
43
44
45
46
47
48
49
machine:
services:
- docker
dependencies:
override:
- docker info
- |
printf '{"version":{"hash":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}}\n' \
"$CIRCLE_SHA1" \
"$CIRCLE_TAG" \
"$CIRCLE_PROJECT_USERNAME" \
"$CIRCLE_PROJECT_REPONAME" \
"$CIRCLE_BUILD_URL" \
| tee config/version.json version.json
- docker build -f Dockerfile-build -t fxa-auth-server:build .
- docker build -f Dockerfile-test -t fxa-auth-server:test .
test:
override:
- docker run fxa-auth-server:test npm run test-ci
deployment:
hub_latest:
owner: mozilla
# push certain branches, they are used by fxa-dev for deployment
branch: /^(master|feature.*|dockerpush.*)$/
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- docker login -e "$DOCKER_EMAIL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
- |
if [ $CIRCLE_BRANCH = "master" ]; then
CIRCLE_BRANCH=latest
fi
echo ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
docker tag fxa-auth-server:build ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
docker push ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
hub_releases:
# push all tags
owner: mozilla
tag: /.*/
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- docker login -e "$DOCKER_EMAIL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
- "echo ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker tag fxa-auth-server:build ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker images"
- "docker push ${DOCKERHUB_REPO}:${CIRCLE_TAG}"