Skip to content

Commit

Permalink
Separate stage from prod deployment (#6675)
Browse files Browse the repository at this point in the history
Only push to single stage region (oregon-b)
  • Loading branch information
jgmize committed Jan 15, 2019
1 parent 29e3aa8 commit 8b9cf3a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
9 changes: 4 additions & 5 deletions bin/run-sync-all.sh
Expand Up @@ -6,11 +6,10 @@ if [ ! -e ./manage.py ]; then
cd $script_parent_dir
fi

if [[ "$BRANCH_NAME" == "prod" ]]; then
ENV_FILE=prod
else
ENV_FILE=master
fi
case "$BRANCH_NAME" in
"stage" | "prod") ENV_FILE=prod ;;
*) ENV_FILE=master ;;
esac

# use honcho to inject the proper env vars
honcho run --env "docker/envfiles/${ENV_FILE}.env" ./bin/sync-all.sh
7 changes: 7 additions & 0 deletions bin/tag-release.sh
Expand Up @@ -19,6 +19,13 @@ while [[ $# -ge 1 ]]; do
shift # past argument or value
done

echo "Did you test on stage first? If not, are you sure you want to skip going to stage?"
read stage
if [ "$stage" == "${stage#[Yy]}" ]; then
# $stage doesn't start with y or Y
exit
fi

# ensure all tags synced
git fetch --tags "$moz_git_remote"
date_tag=$(date +"%Y-%m-%d")
Expand Down
22 changes: 16 additions & 6 deletions docs/pipeline.rst
Expand Up @@ -44,17 +44,24 @@ and the full suite of headless and UI tests are then run against
Firefox on Windows 10 using `Sauce Labs`_. This is handled by the pipeline, and is subject
to change according to the settings in the `master.yml file`_ in the repository.

Push to stage branch
~~~~~~~~~~~~~~~~~~~~~

Whenever a change is pushed to the stage branch, a production docker image is built, published to
`Docker Hub`_, and deployed to a `public staging environment`_. Once the new image is deployed, the
full suite of UI tests is run against it with Firefox, Chrome, and Internet Explorer on
Windows 10, and the sanity suite is run with IE9.

.. _tagged-commit:

Push to prod branch (tagged)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When a tagged commit is pushed to the prod branch, everything that happens during a
untagged push is still run. In addition, the full suite of UI tests is run against
Chrome and Internet Explorer on Windows 10, and the sanity suite is run against older
versions of Internet Explorer (currently IE6 & IE7). If successful, the change is
pushed to staging, tested, and then to production and the same tests are then run against
production. As with untagged pushes, this is all handled by the pipeline, and is subject
When a tagged commit is pushed to the prod branch, a production docker image is built and published
to `Docker Hub`_ if needed (usually this will have already happened as a result of a push to the stage branch),
and deployed to each `production`_ deployment. After each deployment is complete, the full suite of UI tests is
run against Firefox, Chrome and Internet Explorer on Windows 10, and the sanity suite is run against IE9.
As with untagged pushes, this is all handled by the pipeline, and is subject
to change according to the settings in the `prod.yml file`_ in the repository.

**Push to prod cheat sheet**
Expand Down Expand Up @@ -222,3 +229,6 @@ A `bug for the IRC plugin`_ has been raised.
.. _Sauce Labs platform configurator: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator/
.. _enhancement request: https://issues.jenkins-ci.org/browse/JENKINS-26210
.. _bug for the IRC plugin: https://issues.jenkins-ci.org/browse/JENKINS-28175
.. _public staging environment: https://www.allizom.org
.. _Docker Hub: https://hub.docker.com/r/mozorg/bedrock/tags
.. _production: https://www.mozilla.org
2 changes: 0 additions & 2 deletions jenkins/branches/prod.yml
@@ -1,14 +1,12 @@
# see the following for documentation of these options
# http://bedrock.readthedocs.io/en/latest/pipeline.html#configuration
push_public_registry: true
smoke_tests: true
require_tag: true
regions:
- oregon-b
- frankfurt
- iowa-a
apps:
- bedrock-stage
- bedrock-prod
integration_tests:
oregon-b:
Expand Down
15 changes: 15 additions & 0 deletions jenkins/branches/stage.yml
@@ -0,0 +1,15 @@
# see the following for documentation of these options
# http://bedrock.readthedocs.io/en/latest/pipeline.html#configuration
push_public_registry: true
regions:
- oregon-b
apps:
- bedrock-stage
integration_tests:
oregon-b:
- chrome
- download
- firefox
- headless
- ie
- ie9

0 comments on commit 8b9cf3a

Please sign in to comment.