2018-05-31 18:06:23 +03:00
|
|
|
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" \
|
2018-05-31 23:25:40 +03:00
|
|
|
> version.json
|
|
|
|
- docker build -t blurts-server .
|
2018-06-08 23:03:32 +03:00
|
|
|
- cp version.json $CIRCLE_ARTIFACTS
|
2018-05-31 18:06:23 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
override:
|
2018-05-31 23:25:40 +03:00
|
|
|
- docker run blurts-server npm run lint
|
2018-05-31 18:06:23 +03:00
|
|
|
|
|
|
|
deployment:
|
|
|
|
hub_latest:
|
|
|
|
owner: mozilla
|
|
|
|
# push certain branches, they are used 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 blurts-server ${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 blurts-server ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
|
|
|
|
- "docker images"
|
|
|
|
- "docker push ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
|