This repository has been archived by the owner on May 19, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #477 from jcscottiii/master
Move from Travis to CircleCI
- Loading branch information
Showing
4 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
machine: | ||
environment: | ||
GODIST: "go1.6.linux-amd64.tar.gz" | ||
WS: "/home/ubuntu/.go_workspace/src/github.com/18F/cg-deck" | ||
CF_API: "https://api.cloud.gov" | ||
CF_ORGANIZATION: "cf" | ||
CF_API_GC: "https://api.fr.cloud.gov" | ||
CF_ORGANIZATION_GC: "cloud-gov" | ||
post: | ||
- cd cg-deck && nvm install && nvm use && nvm alias default $(nvm current) | ||
- 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: | ||
- "$WS/node_modules/" | ||
pre: | ||
- sudo apt-get update; sudo apt-get install libicu52 | ||
- curl --output /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic https://s3.amazonaws.com/circle-support-bucket/phantomjs/phantomjs-2.0.1-linux-x86_64-dynamic | ||
- chmod a+x /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic | ||
- sudo ln -s --force /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic /usr/local/bin/phantomjs | ||
- go version | ||
- go get github.com/Masterminds/glide | ||
- mkdir -p $WS && cp -R /home/ubuntu/cg-deck/. $WS | ||
- cd $WS && glide install | ||
- cd $WS && npm install | ||
override: | ||
- cd $WS && go build | ||
- cd $WS && npm run build | ||
test: | ||
pre: | ||
- go get github.com/axw/gocov/gocov | ||
- go get github.com/mattn/goveralls | ||
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi | ||
override: | ||
- cd $WS && ./codecheck.sh -u | ||
- cd $WS && npm test | ||
|
||
deployment: | ||
deploy: | ||
branch: [master, staging, deprecated] | ||
owner: 18F | ||
commands: | ||
- 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 | ||
- chmod a+x deploy/circle_deploy.sh && deploy/circle_deploy.sh | ||
production: | ||
tag: /[0-9]+(\.[0-9]+)*/ | ||
owner: 18F | ||
commands: | ||
- 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 | ||
- chmod a+x deploy/circle_deploy.sh && deploy/circle_deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# This script will install the autopilot plugin, login, pick the right manifest and deploy the app with 0 downtime. | ||
|
||
# Command line arguments | ||
# $1 = specified org | ||
# $2 = manifest file path | ||
# $3 = file path to project | ||
|
||
set -e | ||
|
||
curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&source=github' | ||
sudo dpkg -i cf-cli_amd64.deb | ||
cf -v | ||
|
||
# Install autopilot | ||
go get github.com/contraband/autopilot | ||
cf install-plugin -f /home/ubuntu/.go_workspace/bin/autopilot | ||
|
||
|
||
|
||
# Note: Spaces and deployer account username are the same in different environments. | ||
# Only the organization, api, deployer account password differ. | ||
|
||
|
||
CF_PATH="." | ||
if [[ "$CIRCLE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]] | ||
then | ||
CF_MANIFEST="manifest-prod.yml" | ||
CF_SPACE="deck-prod" | ||
CF_APP="cf-deck" | ||
elif [ "$CIRCLE_BRANCH" == "master" ] | ||
then | ||
CF_MANIFEST="manifest-master.yml" | ||
CF_SPACE="deck-stage" | ||
CF_APP="cf-deck" | ||
elif [ "$CIRCLE_BRANCH" == "staging" ] | ||
then | ||
CF_MANIFEST="manifest-staging.yml" | ||
CF_SPACE="deck-stage" | ||
CF_APP="cf-deck-staging" | ||
elif [ "$CIRCLE_BRANCH" == "deprecated" ] | ||
then | ||
CF_MANIFEST="manifest-deprecated.yml" | ||
CF_SPACE="deck-prod" | ||
CF_APP="cg-deck" | ||
else | ||
exit | ||
fi | ||
|
||
echo $CF_MANIFEST | ||
echo $CF_SPACE | ||
|
||
|
||
# Log in to east-west | ||
cf api $CF_API | ||
cf auth $CF_USERNAME $CF_PASSWORD && $CF_BIN target -o $CF_ORGANIZATION -s $CF_SPACE | ||
# Set manifest path for eastwest | ||
MANIFEST_PATH=manifests/eastwest/$CF_MANIFEST | ||
# Run autopilot plugin | ||
cf zero-downtime-push $CF_APP -f $MANIFEST_PATH -p $CF_PATH | ||
|
||
# Log in to govcloud | ||
cf api $CF_API_GC | ||
cf auth $CF_USERNAME $CF_PASSWORD_GC && $CF_BIN target -o $CF_ORGANIZATION_GC -s $CF_SPACE | ||
# Set manifest path for eastwest | ||
MANIFEST_PATH=manifests/govcloud/$CF_MANIFEST | ||
# Run autopilot plugin | ||
cf zero-downtime-push $CF_APP -f $MANIFEST_PATH -p $CF_PATH |
File renamed without changes.