From e63db159f4f5b0da77fcded5dc6d5ed4fb9471e8 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Sat, 23 Jan 2021 17:24:56 +0100 Subject: [PATCH] gitlab-ci-cd/drupal#2 Update documentation for Drupal GitLab pipelines --- .../Screenshot from 2021-01-23 17-15-35.png | 3 ++ .../Screenshot from 2021-01-23 17-20-07.png | 3 ++ docs/gitlab/drupal/index.md | 44 +++++++++++++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 docs/files/screenshots/Screenshot from 2021-01-23 17-15-35.png create mode 100644 docs/files/screenshots/Screenshot from 2021-01-23 17-20-07.png diff --git a/docs/files/screenshots/Screenshot from 2021-01-23 17-15-35.png b/docs/files/screenshots/Screenshot from 2021-01-23 17-15-35.png new file mode 100644 index 0000000..8589b5a --- /dev/null +++ b/docs/files/screenshots/Screenshot from 2021-01-23 17-15-35.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce768f2a4b5beefda014d7e7ba726b90f9035df59dd3171dca9ed4009643819d +size 160498 diff --git a/docs/files/screenshots/Screenshot from 2021-01-23 17-20-07.png b/docs/files/screenshots/Screenshot from 2021-01-23 17-20-07.png new file mode 100644 index 0000000..a149d05 --- /dev/null +++ b/docs/files/screenshots/Screenshot from 2021-01-23 17-20-07.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:606d13f1acb0b5d0c33d25dbb8ba470ffa19dceea5fe08d339a62f4b97637497 +size 135882 diff --git a/docs/gitlab/drupal/index.md b/docs/gitlab/drupal/index.md index eb673a6..6eaad1f 100644 --- a/docs/gitlab/drupal/index.md +++ b/docs/gitlab/drupal/index.md @@ -13,6 +13,7 @@ This project contains a number of pre-configured tasks for GitLab CI/CD that allow to run very powerful pipelines which contain the following stages: - validation +- buildprod - build - prepare - test @@ -64,7 +65,7 @@ project. ### GitLab Variables -Some variables are required for proper access control and you have to provide +Some variables are required for proper access control, and you have to provide them in the project configuration by going to **Settings / CI/CD / Variables** and adding these variables: @@ -95,6 +96,9 @@ include: Validate Environment: extends: '.prerequisites' +Build Prod Site: + extends: '.build-prod' + Build Site: extends: '.build' @@ -159,6 +163,7 @@ Deploy: - echo "Scripts have not been developed yet" cache: {} dependencies: + - 'Build Prod Site' - 'Build Theme' except: refs: @@ -186,6 +191,14 @@ you have to write the scripts for those two tasks yourselves. test stage will be skipped. This is useful e.g. in a development environment where you push and run pipelines often but don't want to run the tests every single time. +- `DISABLE_CI_TEST_BACKSTOP`: if this variable is set to any value, the visual + regression tests with Backstop will be skipped. +- `DISABLE_CI_TEST_BEHAT`: if this variable is set to any value, the Behat + tests will be skipped. +- `DISABLE_CI_TEST_CODESTYLE`: if this variable is set to any value, the + PHP CS tests will be skipped. +- `DISABLE_CI_TEST_PHPUNIT`: if this variable is set to any value, the + PHP unit tests will be skipped. - `CAE`: This variable is being used by the Drupal module [Config auto export](https://www.drupal.org/project/config_auto_export) @@ -196,6 +209,8 @@ used to define dependencies: - `validation` - `Validate Environment` +- `buildprod` + - `Build Prod Site` - `build` - `Build Site` - `Download DB` @@ -249,8 +264,8 @@ The used placeholders in this example are: - `YOURAUTHTOKEN`: your auth token to the LakeDrops GitLab Docker registry. - `INVENTORYNAME`: the name of the Ansible inventory to be used. -To learn more about the Ansible imeages for an inventory and how to setup some -of the configuration files, please have a look into +To learn more about the Ansible imeages for an inventory and how to set up some +configuration files, please have a look into [Docker for Ansible](/docker/ansible). Once you have the GitLab runner for Ansible setup for the Drupal project, @@ -311,3 +326,26 @@ task `Import DB` will then import that dump in the `prepare` stage. Otherwise, those two tasks will be skipped and the task `Update DB` will be executed in the `prepare` stage instead. + +## Example + +We provide a [Demo Drupal 9 project](https://gitlab.lakedrops.com/gitlab-ci-cd/demos/drupal-9) +which uses this GitLab CI framework. If you want to give it a try, login to +our GitLab, go to the project and click on "Request access". Once we've +accepted your request, you can clone the project, make some changes and push +them back to the project. This will [trigger the pipeline](https://gitlab.lakedrops.com/gitlab-ci-cd/demos/drupal-9/-/pipelines) +thet you can watch running. + +The deployed demo site is [available online](https://d9.demo.lakedrops.com). + +The setup for this project is very simple. Because we wanted to protect the +pipeline configuration, we removed the default `.gitlab-ci.yml` file from +the repository and configured the usage of the example pipeline configuration +that you can review in the [Drupal GitLab CI Project](https://gitlab.lakedrops.com/gitlab-ci-cd/drupal/-/blob/master/examples/build-test-deploy-ansible.yml). + + + +Also, all the variables have been configured in the GitLab project settings, +because developers should not have access to them: + + -- GitLab