Skip to content

Commit

Permalink
Gitlab stage & prod (mozilla#8222)
Browse files Browse the repository at this point in the history
* update TEST_IMAGE in www-config .gitlab-ci.yml

* Switch stage & prod branches from jenkins to gitlab

* Delete Jenkinsfile and jenkins directory
  • Loading branch information
jgmize authored Nov 26, 2019
1 parent 7680a3b commit b0430c9
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 567 deletions.
20 changes: 18 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ stages:
build:
stage: build
only:
- gitlab-ci-dev
- master
- stage
- prod
tags:
- oregon-b-shell
script:
Expand All @@ -33,7 +34,22 @@ build:
dev:
extends: .update-config
only:
- gitlab-ci-dev
- master
variables:
NAMESPACE: bedrock-dev

stage:
extends: .update-config
only:
- stage
variables:
CLUSTERS: iowa-a
NAMESPACE: bedrock-stage

prod:
extends: .update-config
only:
- prod
variables:
CLUSTERS: frankfurt iowa-a
NAMESPACE: bedrock-prod
55 changes: 0 additions & 55 deletions Jenkinsfile

This file was deleted.

4 changes: 4 additions & 0 deletions bin/update_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ for CLUSTER in ${CLUSTERS:=iowa-a}; do
fi
done
done

TEST_IMAGE=mozorg/bedrock_test:${GIT_COMMIT}
sed -i -e "s|TEST_IMAGE: .*|TEST_IMAGE: ${TEST_IMAGE}|;s|image: mozorg/bedrock_test.*|image: ${TEST_IMAGE}|" .gitlab-ci.yml

git commit -m "set image to ${DEPLOYMENT_DOCKER_IMAGE} in ${CLUSTERS}" || echo "nothing new to commit"
git push
51 changes: 24 additions & 27 deletions docs/pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Push to master branch
Whenever a change is pushed to the master branch, a new image is built and deployed to the
dev environment, 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.
to change according to the settings in the `.gitlab-ci.yml file in the www-config repository`_.

Push to stage branch
~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -60,7 +60,7 @@ to `Docker Hub`_ if needed (usually this will have already happened as a result
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.
to change according to the settings in the `.gitlab-ci.yml file in the www-config repository`_.

**Push to prod cheat sheet**

Expand Down Expand Up @@ -173,23 +173,30 @@ default can be set and then can be overridden in the individual job configuratio
Adding test runs
~~~~~~~~~~~~~~~~

Test runs can be added by creating a new properties section in the
`integration tests script <https://github.com/mozilla/bedrock/blob/master/docker/bin/run_integration_tests.sh>`_
with the parameters of the new test run. This is simply a bash script and you can duplicate a clause of the case staement.
Test runs can be added by creating a new job in the `.gitlab-ci.yml file in the www-config repository`_
with the desired variables
For example, if you wanted to run tests in Firefox on both Windows 10 and
OS X, you could create the following clauses:
OS X, against our dev environment, you could create the following clauses:

.. code-block:: bash
.. code-block:: yaml
case $1 in
osx-firefox)
BROWSER_NAME=firefox
PLATFORM="OS X 10.11"
;;
win10-firefox)
BROWSER_NAME=firefox
PLATFORM="Windows 10"
;;
dev-test-firefox-osx:
extends:
- .dev
- .test
variables:
BROWSER_NAME: firefox
BROWSER_VERSION: latest
PLATFORM: OS X 10.11

dev-test-firefox-win10:
extends:
- .dev
- .test
variables:
BROWSER_NAME: firefox
BROWSER_VERSION: latest
PLATFORM: Windows 10

You can use `Sauce Labs platform configurator`_ to help with the parameter values.

Expand All @@ -199,23 +206,13 @@ app will be deployed and all of the integration tests defined in the ``jenkins.y
file for that branch will be run. Please announce in our IRC channel (#www on irc.mozilla.org)
that you'll be doing this so that we don't get conflicts.

Known issues in Jenkins
-----------------------
Jenkins stalls after global configuration changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When using the IRC plugin for notifications, global configuration changes can cause
Jenkins to become unresponsive. To make such changes it can be necessary to first
restart Jenkins, as this issue only appears some time after Jenkins has been started.
A `bug for the IRC plugin`_ has been raised.

.. _Deployment Pipeline: https://ci.vpn1.moz.works/blue/organizations/jenkins/bedrock_multibranch_pipeline/branches/
.. _CircleCI: https://circleci.com/
.. _Sauce Labs: https://saucelabs.com/
.. _Jenkinsfile: https://github.com/mozilla/bedrock/tree/master/Jenkinsfile
.. _branch-specific YAML files: https://github.com/mozilla/bedrock/tree/master/jenkins/branches/
.. _master.yml file: https://github.com/mozilla/bedrock/tree/master/jenkins/branches/master.yml
.. _.gitlab-ci.yml file in the www-config repository: https://github.com/mozmeao/www-config/tree/master/.gitlab-ci.yml
.. _prod.yml file: https://github.com/mozilla/bedrock/tree/master/jenkins/branches/prod.yml
.. _bedrock_integration_tests_runner: https://ci.vpn1.moz.works/view/Bedrock/job/bedrock_integration_tests_runner/
.. _configured in Jenkins: https://ci.vpn1.moz.works/configure
Expand Down
12 changes: 0 additions & 12 deletions jenkins/branches/demo/default.env

This file was deleted.

5 changes: 0 additions & 5 deletions jenkins/branches/demo/default.yml

This file was deleted.

10 changes: 0 additions & 10 deletions jenkins/branches/frankfurt-prod.yml

This file was deleted.

11 changes: 0 additions & 11 deletions jenkins/branches/frankfurt-stage-test-only.yml

This file was deleted.

10 changes: 0 additions & 10 deletions jenkins/branches/frankfurt.yml

This file was deleted.

13 changes: 0 additions & 13 deletions jenkins/branches/iowa-a-prod.yml

This file was deleted.

13 changes: 0 additions & 13 deletions jenkins/branches/iowa-a.yml

This file was deleted.

16 changes: 0 additions & 16 deletions jenkins/branches/nosauce-prod.yml

This file was deleted.

14 changes: 0 additions & 14 deletions jenkins/branches/nosauce.yml

This file was deleted.

19 changes: 0 additions & 19 deletions jenkins/branches/prod.yml

This file was deleted.

14 changes: 0 additions & 14 deletions jenkins/branches/run-integration-tests.yml

This file was deleted.

15 changes: 0 additions & 15 deletions jenkins/branches/stage.yml

This file was deleted.

Loading

0 comments on commit b0430c9

Please sign in to comment.