44 строки
1.3 KiB
YAML
44 строки
1.3 KiB
YAML
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 test
|
|
|
|
deployment:
|
|
hub_latest:
|
|
owner: mozilla
|
|
branch: "master"
|
|
commands:
|
|
- "[ ! -z $DOCKERHUB_REPO ]"
|
|
- docker login -e "$DOCKER_EMAIL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
|
- "docker tag fxa-auth-server:build ${DOCKERHUB_REPO}:latest"
|
|
- "docker push ${DOCKERHUB_REPO}:latest"
|
|
|
|
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}"
|