blurts-server/circle.yml

50 строки
1.4 KiB
YAML
Исходник Обычный вид История

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 .
- 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}"