fxa-content-server/circle.yml

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

dependencies:
pre:
2016-10-27 18:54:56 +03:00
- pip install mozdownload mozinstall
- mozdownload --version 57.0b5 --destination firefox.tar.bz2
2016-10-27 18:54:56 +03:00
- mozinstall firefox.tar.bz2
- sudo apt-get install expect tightvncserver
- ulimit -S -n 2048;
- mkdir -p $HOME/.vnc
- bash tests/ci/setvncpass.sh
override:
2016-12-23 23:45:21 +03:00
- tightvncserver :1
- npm install --global retry-cli
- export DISPLAY=:1
- cp server/config/local.json-dist server/config/local.json
- npm i --production
- CONFIG_FILES=server/config/local.json,server/config/production.json,tests/ci/config_circleci.json node_modules/.bin/grunt build
- nohup bash -c "CONFIG_FILES=server/config/local.json,server/config/production.json,tests/ci/config_circleci.json node_modules/.bin/grunt serverproc:dist &"
- npm install intern bower xmlhttprequest firefox-profile request sync-exec convict
post:
- curl 127.0.0.1:3030
- /home/ubuntu/fxa-content-server/firefox/firefox --version
machine:
node:
version: 6
2017-01-24 00:52:42 +03:00
services:
- docker
test:
override:
# retry the build if the attempt failed
- retry -n 1 -- npm run test-circle firefoxBinary=/home/ubuntu/fxa-content-server/firefox/firefox:
parallel: true
# appropriately tag and push the container to dockerhub
deployment:
hub_latest:
# push certain branches, they are used by fxa-dev for deployment
branch: /^(master|feature.*|dockerpush.*)$/
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- git clean -dffx
- docker info
- mkdir -p config
- >
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-content-server:build .
- 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-content-server:build ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
case $CIRCLE_NODE_INDEX in 0) docker push ${DOCKERHUB_REPO}:${CIRCLE_BRANCH} ;; 1) echo "Image pushed in another node" ;; esac
hub_releases:
# push all tags
tag: /.*/
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- git clean -dffx
- docker info
- mkdir -p config
- >
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-content-server:build .
- docker login -e "$DOCKER_EMAIL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
- "echo ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker tag fxa-content-server:build ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker images"
- case $CIRCLE_NODE_INDEX in 0) docker push ${DOCKERHUB_REPO}:${CIRCLE_BRANCH} ;; 1) echo "Image pushed in another node" ;; esac