fxa-auth-server/circle.yml

50 строки
1.5 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 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}"