From f5e34ef9997c97c01e1b204907276a7e7690a846 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 14:55:00 +0200 Subject: [PATCH 1/6] Add a CI/CD pipeline --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9977207 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +stages: + - build + - deploy + +.build: &build + stage: build + script: + - make html + +build:docker: + <<: *build + image: sphinxdoc/sphinx + needs: [ ] \ No newline at end of file -- GitLab From bc8987ed572c3deafc709b92b7161c3c0d0a9ba5 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 15:01:02 +0200 Subject: [PATCH 2/6] Adding docker tag to build job --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9977207..21fd21e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,5 +9,7 @@ stages: build:docker: <<: *build + tags: + - docker image: sphinxdoc/sphinx needs: [ ] \ No newline at end of file -- GitLab From 7ee9e54496f2206a1f8cde33c205b378c17a6575 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 15:05:03 +0200 Subject: [PATCH 3/6] Figuring out the right build steps... --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 21fd21e..fb96619 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ stages: .build: &build stage: build script: + - cd docs - make html build:docker: -- GitLab From 80c28e0b9ae83835c419c027b33c0084a5ffc0c0 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 15:14:34 +0200 Subject: [PATCH 4/6] Test deployment on a harmless path --- .gitlab-ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb96619..60cfeb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,10 +7,28 @@ stages: script: - cd docs - make html + artifacts: + paths: + - docs/build/html build:docker: <<: *build tags: - docker image: sphinxdoc/sphinx - needs: [ ] \ No newline at end of file + needs: [ ] + +.deploy: &deploy + stage: deploy + script: + - cp -rv docs/build/html ${DEPLOY_PATH} + +deploy:prod: + <<: *deploy + tags: + - caesarvm + # only: + # - main + needs: [ "build:docker" ] + variables: + DEPLOY_PATH: "/test/wiki/docs/build/html" \ No newline at end of file -- GitLab From c20c2242a0bc9b90b821c459fa871ffe974204f1 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 16:46:32 +0200 Subject: [PATCH 5/6] Try to fix deploy jobs failing --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60cfeb8..4c70d47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ build:docker: .deploy: &deploy stage: deploy script: - - cp -rv docs/build/html ${DEPLOY_PATH} + - cp -rv docs/build/html/* ${DEPLOY_PATH} deploy:prod: <<: *deploy @@ -31,4 +31,5 @@ deploy:prod: # - main needs: [ "build:docker" ] variables: - DEPLOY_PATH: "/test/wiki/docs/build/html" \ No newline at end of file + DEPLOY_PATH: "/test/wiki/docs/build/html" + GIT_STRATEGY: clone \ No newline at end of file -- GitLab From 2ddb81a3f0f043709d395bb77a1cebe07378a636 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Wed, 30 Aug 2023 16:49:58 +0200 Subject: [PATCH 6/6] Enable deploy only for main branch and fix deploy path --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c70d47..c62d3ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,9 +27,9 @@ deploy:prod: <<: *deploy tags: - caesarvm - # only: - # - main + only: + - main needs: [ "build:docker" ] variables: - DEPLOY_PATH: "/test/wiki/docs/build/html" + DEPLOY_PATH: "/app/wiki/docs/build/html" GIT_STRATEGY: clone \ No newline at end of file -- GitLab