[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [donate-static/master] Add CI file



commit 7c27624fb568fa3957079dc43dc470fea5af1b1b
Author: kez <kez@xxxxxxxxxxxxxx>
Date:   Wed Oct 20 11:04:53 2021 -0700

    Add CI file
---
 .gitlab-ci.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..db9d965f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,64 @@
+image: debian:buster-slim
+
+
+# This template should be usable on any system that's based on apt.
+# taken from tor gitlabci
+
+.apt-template: &apt-template |
+      export LC_ALL=C.UTF-8
+      echo Etc/UTC > /etc/timezone
+      mkdir -p apt-cache
+      export APT_CACHE_DIR="$(pwd)/apt-cache"
+      echo 'quiet "1";' \
+           'APT::Install-Recommends "0";' \
+           'APT::Install-Suggests "0";' \
+           'APT::Acquire::Retries "20";' \
+           'APT::Get::Assume-Yes "true";' \
+           'Dpkg::Use-Pty "0";' \
+           "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+        >> /etc/apt/apt.conf.d/99gitlab
+      apt-get update -qq
+      apt-get upgrade -qy
+
+variables:
+  GIT_SUBMODULE_STRATEGY: recursive
+  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
+  TRANSLATION_BRANCH: "donate-static-contentspot"
+
+
+stages:
+    - build
+
+pages:
+  cache:
+    key: $CI_PROJECT_PATH_SLUG.${CI_COMMIT_REF_SLUG}
+    paths:
+      - packages
+      - lego
+      - apt-cache
+      - venv
+      - .cache/pip
+      - .cache/lektor/builds/
+  stage: build
+  script:
+    - *apt-template
+    - DEBIAN_FRONTEND=noninteractive apt-get install gettext npm nodejs python3-babel python3-pip git python3-inifile python3-dev python3-setuptools python3-openssl python3-cryptography i18nspector apt-utils ca-certificates -y
+    - npm install -g npm@latest
+    - pip3 install virtualenv
+    - virtualenv venv
+    - source venv/bin/activate
+    - pip3 install lektor
+    - echo 'checking out translations'
+    - rm -rf i18n
+    - git clone --branch $TRANSLATION_BRANCH https://git.torproject.org/translation.git i18n
+    - echo 'reinstall lektor plugins'
+    - lektor project-info --output-path
+    - lektor plugins reinstall
+    - echo 'building lektor 3 more times to get translations in place'
+    - for i in {1..3}; do lektor build --output-path public -f npm
+  artifacts:
+    paths:
+      - public
+      - i18n
+  rules:
+    - when: always



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits