51 строка
1.6 KiB
YAML
51 строка
1.6 KiB
YAML
machine:
|
|
services:
|
|
- docker
|
|
- redis
|
|
|
|
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 --net=host -p 6379:6379 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}"
|