[tor-commits] [donate-static/master] Add static-shim deploy job to gitlab ci file

kez at torproject.org kez at torproject.org
Wed Nov 3 16:31:39 UTC 2021


commit 80a0be3cca40ab893dc71b192ba8106803e3154d
Author: kez <kez at torproject.org>
Date:   Wed Nov 3 09:31:16 2021 -0700

    Add static-shim deploy job to gitlab ci file
---
 .gitlab-ci.yml | 61 +++++++++++++++++++---------------------------------------
 1 file changed, 20 insertions(+), 41 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0abc34f6..012760e6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,10 @@ image: node:current-bullseye
 # This template should be usable on any system that's based on apt.
 # taken from tor gitlabci
 
+include:
+  project: tpo/tpa/ci-templates
+  file: static-shim-deploy.yml
+
 .apt-template: &apt-template |
       export LC_ALL=C.UTF-8
       echo Etc/UTC > /etc/timezone
@@ -23,12 +27,15 @@ variables:
   GIT_SUBMODULE_STRATEGY: recursive
   PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
   TRANSLATION_BRANCH: "donate-static-contentspot"
+  SITE_URL: styleguide.torproject.org
+  SUBDIR: public/
 
 stages:
     - build
+    - deploy
     - test_l10n
 
-pages:
+build:
   cache:
     key: $CI_PROJECT_PATH_SLUG.${CI_COMMIT_REF_SLUG}
     paths:
@@ -40,6 +47,10 @@ pages:
       - .cache/lektor/builds/
   stage: build
   script:
+    # This sets LEKTOR_ENV to prod or dev respectively
+    - LEKTOR_ENV=dev
+    - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then LEKTOR_ENV=prod; fi
+    - export LEKTOR_ENV
     - *apt-template
     - DEBIAN_FRONTEND=noninteractive apt-get install gettext python3-babel python3-pip git python3-inifile python3-dev python3-setuptools python3-openssl python3-cryptography i18nspector apt-utils ca-certificates -y
     - pip3 install virtualenv
@@ -61,7 +72,7 @@ pages:
   rules:
     - when: always
 
-check_new_strings:
+pages:
   cache:
     key: $CI_PROJECT_PATH_SLUG.${CI_COMMIT_REF_SLUG}
     paths:
@@ -70,46 +81,14 @@ check_new_strings:
       - apt-cache
       - venv
       - .cache/pip
-
-  stage: test_l10n
-  needs: [pages]
-  allow_failure: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
-    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
-    - if: '$CI_COMMIT_BRANCH == "translations"'
-      when: never
-    - changes:
-      - content/**/*.lr
-      - templates/**/*
+      - .cache/lektor/builds/
+  stage: pages
+  dependencies:
+      - build
   script:
-    - *apt-template
-    - DEBIAN_FRONTEND=noninteractive apt-get install gettext git python3-dev python3-setuptools i18nspector python3-polib python3-requests ca-certificates apt-utils -y
-    - git clone https://gitlab.torproject.org/tpo/community/l10n.git
-    - echo 'lets see if there are any updates in the strings for translation'
-    - l10n/bin/check_po_status.py $TRANSLATION_BRANCH
+      - rm -r public/.lektor
   artifacts:
     paths:
       - public
-      - i18n
-      - l10n
-
-check_l10n:
-  allow_failure: true
-  cache:
-    key: $CI_PROJECT_PATH_SLUG.${CI_COMMIT_REF_SLUG}
-    paths:
-      - packages
-      - lego
-      - apt-cache
-      - venv
-      - i18n
-      - .cache/pip
-  stage: test_l10n
-  needs: [pages]
-  only:
-    - translations
-  script:
-    - DEBIAN_FRONTEND=noninteractive apt-get install gettext i18nspector python3-polib ca-certificates -y
-    - echo 'lets see if there are any broken links on the translations'
-    - l10n/bin/check_markdown_links.py i18n/
+  rules:
+    - when: always



More information about the tor-commits mailing list