2016-09-26 19:56:13 +03:00
|
|
|
dependencies:
|
|
|
|
pre:
|
2016-10-27 18:54:56 +03:00
|
|
|
- pip install mozdownload mozinstall
|
2017-10-10 23:37:09 +03:00
|
|
|
- mozdownload --version 57.0b5 --destination firefox.tar.bz2
|
2016-10-27 18:54:56 +03:00
|
|
|
- mozinstall firefox.tar.bz2
|
2016-09-26 19:56:13 +03:00
|
|
|
- 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
|
2016-12-16 19:33:29 +03:00
|
|
|
- npm install --global retry-cli
|
2016-12-29 01:40:49 +03:00
|
|
|
- export DISPLAY=:1
|
2016-09-26 19:56:13 +03:00
|
|
|
- cp server/config/local.json-dist server/config/local.json
|
|
|
|
- npm i --production
|
2016-10-19 17:42:37 +03:00
|
|
|
- CONFIG_FILES=server/config/local.json,server/config/production.json,tests/ci/config_circleci.json node_modules/.bin/grunt build
|
2016-09-26 19:56:13 +03:00
|
|
|
- nohup bash -c "CONFIG_FILES=server/config/local.json,server/config/production.json,tests/ci/config_circleci.json node_modules/.bin/grunt serverproc:dist &"
|
2017-10-10 23:37:09 +03:00
|
|
|
- npm install intern bower xmlhttprequest firefox-profile request sync-exec convict
|
2016-09-26 19:56:13 +03:00
|
|
|
post:
|
|
|
|
- curl 127.0.0.1:3030
|
2016-12-10 04:16:52 +03:00
|
|
|
- /home/ubuntu/fxa-content-server/firefox/firefox --version
|
2016-09-26 19:56:13 +03:00
|
|
|
|
|
|
|
machine:
|
|
|
|
node:
|
2017-06-29 02:56:46 +03:00
|
|
|
version: 6
|
2017-01-24 00:52:42 +03:00
|
|
|
services:
|
|
|
|
- docker
|
2016-09-26 19:56:13 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
override:
|
2016-12-16 19:33:29 +03:00
|
|
|
# retry the build if the attempt failed
|
|
|
|
- retry -n 1 -- npm run test-circle firefoxBinary=/home/ubuntu/fxa-content-server/firefox/firefox:
|
2016-10-19 17:42:37 +03:00
|
|
|
parallel: true
|
2017-01-23 23:58:30 +03:00
|
|
|
|
|
|
|
# appropriately tag and push the container to dockerhub
|
|
|
|
deployment:
|
|
|
|
hub_latest:
|
2017-04-25 18:09:06 +03:00
|
|
|
# push certain branches, they are used by fxa-dev for deployment
|
|
|
|
branch: /^(master|feature.*|dockerpush.*)$/
|
2017-01-23 23:58:30 +03:00
|
|
|
commands:
|
|
|
|
- "[ ! -z $DOCKERHUB_REPO ]"
|
2017-04-12 18:06:15 +03:00
|
|
|
- git clean -dffx
|
2017-01-23 23:58:30 +03:00
|
|
|
- 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"
|
2017-04-28 21:29:07 +03:00
|
|
|
- |
|
|
|
|
if [ $CIRCLE_BRANCH = "master" ]; then
|
2017-04-25 18:09:06 +03:00
|
|
|
CIRCLE_BRANCH=latest
|
|
|
|
fi
|
2017-04-28 21:29:07 +03:00
|
|
|
|
|
|
|
echo ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
|
|
|
|
docker tag fxa-content-server:build ${DOCKERHUB_REPO}:${CIRCLE_BRANCH}
|
2017-05-23 21:14:50 +03:00
|
|
|
|
|
|
|
case $CIRCLE_NODE_INDEX in 0) docker push ${DOCKERHUB_REPO}:${CIRCLE_BRANCH} ;; 1) echo "Image pushed in another node" ;; esac
|
2017-01-23 23:58:30 +03:00
|
|
|
|
|
|
|
hub_releases:
|
|
|
|
# push all tags
|
|
|
|
tag: /.*/
|
|
|
|
commands:
|
|
|
|
- "[ ! -z $DOCKERHUB_REPO ]"
|
2017-04-12 18:06:15 +03:00
|
|
|
- git clean -dffx
|
2017-01-23 23:58:30 +03:00
|
|
|
- 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"
|
2017-05-23 21:14:50 +03:00
|
|
|
- case $CIRCLE_NODE_INDEX in 0) docker push ${DOCKERHUB_REPO}:${CIRCLE_BRANCH} ;; 1) echo "Image pushed in another node" ;; esac
|