summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2019-09-13 19:04:28 +0200
committerlouiz’ <louiz@louiz.org>2019-09-15 21:41:39 +0200
commitdb3c5f4bc48331c1ee687fa18c1906fb139f502c (patch)
tree4f3143c7733f19bda506035211b3de324da2aae5
parentf16a9882f223f6a393631ad885da202f63610b5d (diff)
downloadbiboumi-db3c5f4bc48331c1ee687fa18c1906fb139f502c.tar.gz
biboumi-db3c5f4bc48331c1ee687fa18c1906fb139f502c.tar.bz2
biboumi-db3c5f4bc48331c1ee687fa18c1906fb139f502c.tar.xz
biboumi-db3c5f4bc48331c1ee687fa18c1906fb139f502c.zip
ci: Add a job to deploy the doc for MRs
-rw-r--r--.gitlab-ci.yml70
1 files changed, 48 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c783e6a..eebc96f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -263,49 +263,75 @@ packaging:archlinux:
- ".gitlab-ci.yml"
- "doc/**/*"
-deploy:doc:latest:
+# The jobs with the secure tag need to access directories where important
+# files are stored: the latest doc, etc.'
+# Other jobs can not access these, otherwise anybody doing a merge request
+# could delete the official doc
+.deploy:doc:
extends: .doc_changed
stage: deploy
- tags:
- - www
- environment:
- name: doc.latest
- url: https://doc.biboumi.louiz.org
image: docker.louiz.org/louiz/biboumi/doc-builder
script:
- cd doc/
- make html
- - rm -rf /www/latest
- - mv _build/html /www/latest
+ - rm -rf /www/$DOC_DEPLOY_DIR
+ - mv _build/html /www/$DOC_DEPLOY_DIR
dependencies: []
+deploy:doc:latest:
+ extends: .deploy:doc
+ only:
+ - master@louiz/biboumi
+ tags:
+ - www
+ - secure
+ environment:
+ name: doc.latest
+ url: https://doc.biboumi.louiz.org
+ variables:
+ DOC_DEPLOY_DIR: "latest"
+
deploy:doc:tag:
- extends: .doc_changed
- stage: deploy
+ extends: .deploy:doc
+ only:
+ - tags
tags:
- www
+ - secure
environment:
name: doc.$CI_COMMIT_TAG
url: https://doc.biboumi.louiz.org/$CI_COMMIT_TAG/
- on_stop: undeploy_doc_tag
- image: docker.louiz.org/louiz/biboumi/doc-builder
- script:
- - cd doc/
- - make html
- - mv _build/html /www/$CI_COMMIT_TAG
- dependencies: []
+ variables:
+ DOC_DEPLOY_DIR: $CI_COMMIT_TAG
+
+deploy:doc:mr:
+ extends: .deploy:doc
+ only:
+ - merge_requests
+ tags:
+ - www
+ - unsecure
+ environment:
+ name: doc.mr.$CI_MERGE_REQUEST_ID
+ url: https://doc.biboumi.louiz.org/mr/$CI_MERGE_REQUEST_ID/
+ on_stop: undeploy:doc:mr
+ variables:
+ DOC_DEPLOY_DIR: $CI_MERGE_REQUEST_ID
-undeploy:doc:tag:
+undeploy:doc:mr:
stage: deploy
tags:
- www
+ - unsecure
+ only:
+ - merge_requests
+ image: docker.louiz.org/louiz/biboumi/doc-builder
variables:
GIT_STRATEGY: none
+ when: manual
environment:
- name: doc.$CI_COMMIT_TAG
+ name: doc.mr.$CI_MERGE_REQUEST_ID
action: stop
- image: docker.louiz.org/louiz/biboumi/doc-builder
script:
- - rm -rf /www/$CI_COMMIT_TAG
- when: manual
+ - rm -rf /www/$CI_MERGE_REQUEST_ID
dependencies: []