From 46545a941883232dd187a6cea02ea7a6fc80b111 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 29 Aug 2020 12:18:51 -0600 Subject: [PATCH 1/5] Docs deployment and update example --- .gitlab-ci.yml | 11 +++++++++++ docs/administration/administration/updating.md | 13 ++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9c43e5ce..e4b7d54f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ stages: - lint - test - build + - deploy-docs before_script: - yarn @@ -39,6 +40,16 @@ build-production: paths: - static +deploy-docs: + stage: deploy-docs + script: + - curl -X POST -F token=5dca17d4153d8096c8576a5ea44471 -F ref=master https://gitlab.com/api/v4/projects/15685485/trigger/pipeline + only: + refs: + - develop + changes: + - docs/* + # Supposed to fail when translations are outdated, instead always passes # # i18n: diff --git a/docs/administration/administration/updating.md b/docs/administration/administration/updating.md index bbda31341..6b173c8cd 100644 --- a/docs/administration/administration/updating.md +++ b/docs/administration/administration/updating.md @@ -10,13 +10,12 @@ To update Soapbox FE via the command line, do the following: ``` # Download the build. - curl -L https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/v(latest.version.here)/download?job=build-production -o soapbox-fe.zip # Remove all the current Soapbox FE build in Pleroma's instance directory. -sudo rm -R /opt/pleroma/instance/static/packs -sudo rm /opt/pleroma/instance/static/index.html -sudo rm -R /opt/pleroma/instance/static/sounds +rm -R /opt/pleroma/instance/static/packs +rm /opt/pleroma/instance/static/index.html +rm -R /opt/pleroma/instance/static/sounds # Unzip the new build to Pleroma's instance directory. busybox unzip soapbox-fe.zip -o -d /opt/pleroma/instance @@ -26,11 +25,11 @@ busybox unzip soapbox-fe.zip -o -d /opt/pleroma/instance You can also update Soapbox using [Sandia Mesa's updater bash script for Soapbox FE](https://code.sandiamesa.com/traboone/soapbox-update). -First, download the updater script if you haven't yet: ``curl -O https://code.sandiamesa.com/traboone/soapbox-update/raw/branch/master/soapbox-update.sh`` +First, download the updater script if you haven't yet: ``sudo -Hu pleroma wget -P /var/lib/pleroma https://code.sandiamesa.com/traboone/soapbox-update/raw/branch/master/soapbox-update.sh -N`` -Then, set the permissions of the updater script so that it can be executed: ``chmod u+x soapbox-update.sh`` +Then, set the permissions of the updater script so that it can be executed: ``chmod u+x /var/lib/pleroma/soapbox-update.sh`` -Finally, run ``sudo ./soapbox-update.sh``. +Finally, go to the Pleroma user's directory ``cd /var/lib/pleroma`` and then run ``sudo -Hu pleroma ./soapbox-update.sh``. ## After updating Soapbox From b36ac6857e368af06729beae0f3ed4610ba8eff1 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 29 Aug 2020 15:22:17 -0600 Subject: [PATCH 2/5] Use CI/CD variables instead for docs deployment --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4b7d54f5..8ed5a1f5b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ build-production: deploy-docs: stage: deploy-docs script: - - curl -X POST -F token=5dca17d4153d8096c8576a5ea44471 -F ref=master https://gitlab.com/api/v4/projects/15685485/trigger/pipeline + - curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F"ref=master" https://gitlab.com/api/v4/projects/15685485/trigger/pipeline only: refs: - develop From cf605ebb91c021205ef0ed8d3beb3b86ac9f125a Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 29 Aug 2020 15:26:28 -0600 Subject: [PATCH 3/5] Before script and image for docs deployment --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ed5a1f5b..6491e0a2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,8 +42,9 @@ build-production: deploy-docs: stage: deploy-docs - script: - - curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F"ref=master" https://gitlab.com/api/v4/projects/15685485/trigger/pipeline + image: python:3.8-alpine + before_script: apk add curl + script: curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline only: refs: - develop From f482ddf86b67065af66c29b67393c1f9b4801521 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 29 Aug 2020 15:51:17 -0600 Subject: [PATCH 4/5] Fix GitLab CI error --- .gitlab-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6491e0a2b..bae1ef151 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,13 +43,15 @@ build-production: deploy-docs: stage: deploy-docs image: python:3.8-alpine - before_script: apk add curl - script: curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline + before_script: + - apk add curl + script: + - curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline only: refs: - - develop + - develop changes: - - docs/* + - docs/* # Supposed to fail when translations are outdated, instead always passes # From db037c9fbf15d75fd1e21daf375bfa3726bb2a1a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 30 Aug 2020 13:49:42 -0500 Subject: [PATCH 5/5] Docs CI: try $DOCS_TRIGGER_PIPELINE --> $CI_JOB_TOKEN --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bae1ef151..86ec958f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ deploy-docs: before_script: - apk add curl script: - - curl -X POST -F"token=$DOCS_TRIGGER_PIPELINE" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline + - curl -X POST -F"token=$CI_JOB_TOKEN" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline only: refs: - develop