.circleci/_circle.yml_old
machine:
services:
- docker
environment:
GODIST: "go1.9.linux-amd64.tar.gz"
WS: "/home/ubuntu/.go_workspace/src/github.com/18F/cg-dashboard"
CF_ORGANIZATION: "cloud-gov"
post:
- cd cg-dashboard && nvm install && nvm use && nvm alias default $(cat .nvmrc)
- mkdir -p download
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
dependencies:
cache_directories:
- "node_modules"
pre:
- sudo apt-get update; sudo apt-get install libicu52
- go version
- go get -u github.com/golang/dep/cmd/dep
- rm -rf $WS
- mkdir -p $(dirname $WS) && ln -s $(pwd) $WS
- cd $WS && dep ensure
- npm install
- npm run test-selenium-install
override:
- cd $WS && go build
- npm run build
# chromedriver
- wget https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- sudo cp chromedriver /usr/local/bin/chromedriver
test:
pre:
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
override:
- export DISPLAY=:99.0 # taken from https://github.com/siddharthkp/lighthouse-ci/issues/1
- sh -e /etc/init.d/xvfb start || echo \"Unable to start virtual display.\"
- sleep 5 # give xvfb some time to start
- cd $WS && npm test
- NODE_ENV=prod npm run build
- sleep 5
- cd $WS && npm run test-performance || true
- cd $WS && ./codecheck.sh
deployment:
deploy:
branch: [master, demo]
owner: 18F
commands:
- NODE_ENV=prod npm run build-prod
- pip install --user ruamel.yaml
- export BUILD_INFO=build::$CIRCLE_BRANCH::$(date -u "+%Y-%m-%d-%H-%M-%S")::$CIRCLE_BUILD_NUM::$(deploy/npm-version.sh) && python deploy/vars-to-manifest.py
- cd $WS && ./deploy/circle_deploy.sh
production:
tag: /[0-9]+(\.[0-9]+)*/
owner: 18F
commands:
- NODE_ENV=prod npm run build-prod
- pip install --user ruamel.yaml
- export BUILD_INFO=build::$CIRCLE_BRANCH::$(date -u "+%Y-%m-%d-%H-%M-%S")::$CIRCLE_BUILD_NUM::$(deploy/npm-version.sh) && python deploy/vars-to-manifest.py
- cd $WS && ./deploy/circle_deploy.sh