From b6f50713d31ffa9494367d2e48635a686f1ad13f Mon Sep 17 00:00:00 2001 From: Aaron D Borden Date: Tue, 13 Dec 2016 17:48:10 -0800 Subject: [PATCH] Rename staging server - Remove the old environment we called "staging" - What we used to call master, is now "staging" - Add a demo environment for folks to push incomplete work, or branches for demonstration. --- CONTRIBUTING.md | 11 ++--- README.md | 2 +- RELEASE.md | 11 ++--- circle.yml | 2 +- deploy/circle_deploy.sh | 10 ++--- deploy/travis_deploy.sh | 62 -------------------------- manifests/eastwest/manifest-demo.yml | 7 +++ manifests/eastwest/manifest-master.yml | 7 --- manifests/govcloud/manifest-demo.yml | 7 +++ manifests/govcloud/manifest-master.yml | 7 --- 10 files changed, 33 insertions(+), 93 deletions(-) delete mode 100755 deploy/travis_deploy.sh create mode 100644 manifests/eastwest/manifest-demo.yml delete mode 100644 manifests/eastwest/manifest-master.yml create mode 100644 manifests/govcloud/manifest-demo.yml delete mode 100644 manifests/govcloud/manifest-master.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ce757e3..f4e58d6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ The criteria for moving a card through the columns is in the main cloud.gov prod - Have all new files and newly touched files linted (new files can skip linting if under tight deadline) - Have all previous unit tests running without error. - Non-JSX code covered in units tests. - - Is deployed on a staging site or live site so other team members can see/use it. + - Is deployed on a demo, staging or live site so other team members can see/use it. ##### Done - Stakeholders see and approve the work as meeting acceptance criteria. @@ -75,13 +75,14 @@ For more information, see the high-level [cloud.gov respository](https://github. - Any team member (code author or otherwise) can merge the code once it has an approved review. - Updates on PRs in the repo will be posted in the #cloud-gov-nav-news Slack channel -- It's fine to merge code that isn't "feature complete." The staging branch is - not currently in use, so it is fine to use it for "in progress work". +- It's fine to merge code that isn't "feature complete." The `demo` branch is + not currently in use, so it is fine to force push the branch for "in progress + work", e.g. `git push -f origin HEAD:demo`. - We're currently not focusing on acceptance tests right now due to the tests not being easily repeatable and having a clean data state. If a change breaks an acceptance test, spend 10 minutes trying to fix it before disabling the test. Do not write new acceptance tests. #### Other Git standards - Squashing commits is allowed but discouraged, except in rare instances. -- The team prefers rebasing over merging, though we use GitHub to close out pull requests. This means that PRs will be merged, but if you're refreshing a local branch make sure to use rebase. For example, if you want to update your `staging` branch to reflect the most recent changes on GitHub use `git pull --rebase origin staging`. +- The team prefers rebasing over merging, though we use GitHub to close out pull requests. This means that PRs will be merged, but if you're refreshing a local branch make sure to use rebase. For example, if you want to update your `new-feature` branch to reflect the most recent changes on GitHub use `git pull --rebase origin new-feature`. ### Branches - Open branches off main repo due to Circle CI env var problem. For now, remember to branch off of the `master` branch. @@ -145,7 +146,7 @@ The code base includes linting configurations and tools, but is currently not fu ## Performance Adding performance tracking and metrics is currently a TODO. Here are some items in consideration: - What metrics should be tracked? ie: page load, speed index, custom events, number of requests, total request size, etc. -- When should performance be measured? ie: on live staging site, locally during test runs. +- When should performance be measured? ie: on staging site, locally during test runs. - How should performance be measured? ie: with what tools - What should performance budgets for decided metrics be? ie: faster then 1000 for speed index, faster then 1s for certain custom event, total request size below 2mb. - How should performance metrics and budgets be incorporated into workflow? Going over a budget requires re-implementation, or issue. diff --git a/README.md b/README.md index 95e332bd..7f1a0662 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![Code Climate](https://codeclimate.com/github/18F/cg-dashboard/badges/gpa.svg)](https://codeclimate.com/github/18F/cg-dashboard) Environments: [Production](https://dashboard.cloud.gov) -[Master](https://dashboard-master.apps.cloud.gov) [Staging](https://dashboard-staging.apps.cloud.gov) +[Demo](https://dashboard-demo.apps.cloud.gov) ## Introduction diff --git a/RELEASE.md b/RELEASE.md index 8b8e1a81..98dcf7db 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -29,11 +29,12 @@ change the version: Currently, the site does not have visual regression testing so must be manually tested for breaking visual changes. Here is a simple script to assist in manual -testing. Generally, it's best to look through all the pages and check if anything -looks off. Testing should generally be done on the master environment, -dashboard-master.apps.cloud.gov, when all the necessary code is on the master branch -and has been deployed. To check that the master branch has been deployed, check -travis CI. +testing. Generally, it's best to look through all the pages and check if +anything looks off. Testing should generally be done on the staging environment, +[dashboard-staging.apps.cloud.gov](https://dashboard-staging.apps.cloud.gov/), +when all the necessary code is on the master branch and has been deployed. To +check that the master branch has been deployed, check [Circle +CI](https://circleci.com/gh/18F/cg-dashboard). #### Script diff --git a/circle.yml b/circle.yml index 0f763907..9346a84a 100644 --- a/circle.yml +++ b/circle.yml @@ -42,7 +42,7 @@ test: deployment: deploy: - branch: [master, staging, deprecated] + branch: [master, demo, deprecated] owner: 18F commands: - cd $WS && pip install --user ruamel.yaml diff --git a/deploy/circle_deploy.sh b/deploy/circle_deploy.sh index e5636668..bf310ed0 100644 --- a/deploy/circle_deploy.sh +++ b/deploy/circle_deploy.sh @@ -30,15 +30,15 @@ then CF_SPACE="dashboard-prod" CF_APP="cg-dashboard" elif [ "$CIRCLE_BRANCH" == "master" ] -then - CF_MANIFEST="manifest-master.yml" - CF_SPACE="dashboard-stage" - CF_APP="cg-dashboard-master" -elif [ "$CIRCLE_BRANCH" == "staging" ] then CF_MANIFEST="manifest-staging.yml" CF_SPACE="dashboard-stage" CF_APP="cg-dashboard-staging" +elif [ "$CIRCLE_BRANCH" == "demo" ] +then + CF_MANIFEST="manifest-demo.yml" + CF_SPACE="dashboard-stage" + CF_APP="cg-dashboard-demo" elif [ "$CIRCLE_BRANCH" == "deprecated" ] then CF_MANIFEST="manifest-deprecated.yml" diff --git a/deploy/travis_deploy.sh b/deploy/travis_deploy.sh deleted file mode 100755 index 08c9dc95..00000000 --- a/deploy/travis_deploy.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/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 - -# Note: Spaces and deployer account username are the same in different environments. -# Only the organization, api, deployer account password differ. - - -CF_PATH="." -if [[ "$TRAVIS_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 [ "$TRAVIS_BRANCH" == "master" ] -then - CF_MANIFEST="manifest-master.yml" - CF_SPACE="deck-stage" - CF_APP="cf-deck" -elif [ "$TRAVIS_BRANCH" == "staging" ] -then - CF_MANIFEST="manifest-staging.yml" - CF_SPACE="deck-stage" - CF_APP="cf-deck-staging" -elif [ "$TRAVIS_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 - -export CF_BIN=$CLIPATH/out/cf -# Install autopilot -$CF_BIN install-plugin -f $GOAUTOPILOT_BIN - -# Log in to east-west -$CF_BIN api $CF_API -$CF_BIN 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_BIN zero-downtime-push $CF_APP -f $MANIFEST_PATH -p $CF_PATH - -# Log in to govcloud -$CF_BIN api $CF_API_GC -$CF_BIN 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_BIN zero-downtime-push cf-deck -f $MANIFEST_PATH -p $CF_PATH diff --git a/manifests/eastwest/manifest-demo.yml b/manifests/eastwest/manifest-demo.yml new file mode 100644 index 00000000..f249a6b2 --- /dev/null +++ b/manifests/eastwest/manifest-demo.yml @@ -0,0 +1,7 @@ +--- +inherit: manifest-region-base.yml +applications: +- name: cg-dashboard-demo + host: dashboard-demo + env: + CONSOLE_HOSTNAME: https://dashboard-demo.apps.cloud.gov diff --git a/manifests/eastwest/manifest-master.yml b/manifests/eastwest/manifest-master.yml deleted file mode 100644 index b6dc405d..00000000 --- a/manifests/eastwest/manifest-master.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -inherit: manifest-region-base.yml -applications: -- name: cg-dashboard-master - host: dashboard-master - env: - CONSOLE_HOSTNAME: https://dashboard-master.apps.cloud.gov diff --git a/manifests/govcloud/manifest-demo.yml b/manifests/govcloud/manifest-demo.yml new file mode 100644 index 00000000..9e68b147 --- /dev/null +++ b/manifests/govcloud/manifest-demo.yml @@ -0,0 +1,7 @@ +--- +inherit: manifest-region-base.yml +applications: +- name: cg-dashboard-demo + host: dashboard-demo + env: + CONSOLE_HOSTNAME: https://dashboard-demo.app.cloud.gov diff --git a/manifests/govcloud/manifest-master.yml b/manifests/govcloud/manifest-master.yml deleted file mode 100644 index ac740bb3..00000000 --- a/manifests/govcloud/manifest-master.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -inherit: manifest-region-base.yml -applications: -- name: cg-dashboard-master - host: dashboard-master - env: - CONSOLE_HOSTNAME: https://dashboard-master.app.cloud.gov