4 - if: $CI_MERGE_REQUEST_IID
6 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
8 # Please, make sure to only use images from `registry.gitlab.tails.boum.org`,
9 # as we give significant privileges to our Runners wrt. what they can do in our
11 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:bookworm
14 GET_SOURCES_ATTEMPTS: 10
17 - export DEBIAN_FRONTEND=noninteractive
20 .prepare-lint-po: &prepare-lint-po
21 - apt-get -qy install git i18nspector
22 - git clone https://gitlab.tails.boum.org/tails/jenkins-tools.git /tmp/jenkins-tools
26 - if: '$CI_COMMIT_BRANCH == "master"'
28 IKIWIKI_RCS_OPTION: --rcs git
29 - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
32 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/ikiwiki:bookworm
34 key: website-$CI_COMMIT_REF_SLUG
36 - config/chroot_local-includes/usr/share/doc/tails/website
42 - config/chroot_local-includes/usr/share/doc/tails/website
46 UNDERLAYS_DIR: ${CI_PROJECT_DIR}/underlays
48 - mkdir -p ${UNDERLAYS_DIR}
50 for i in etcher-binary promotion-material; do
51 test -d ${UNDERLAYS_DIR}/${i} || git clone --depth=1 https://gitlab.tails.boum.org/tails/${i}.git ${UNDERLAYS_DIR}/${i}
52 git -C ${UNDERLAYS_DIR}/${i} switch master
53 git -C ${UNDERLAYS_DIR}/${i} pull
56 if [ "$CI_COMMIT_BRANCH" == "master" ]; then
57 git checkout -B master $CI_COMMIT_SHA
58 git branch -u origin/master
59 git remote set-url origin https://user:$WEBSITE_BUILD_PROJECT_ACCESS_TOKEN@gitlab.tails.boum.org/tails/tails.git
62 ./build-website ${IKIWIKI_RCS_OPTION} \
63 --url "https://tails.net" \
66 --historyurl "https://gitlab.tails.boum.org/tails/tails/-/commits/master/wiki/src/[[file]]" \
67 --diffurl "https://gitlab.tails.boum.org/tails/tails/-/commit/[[sha1_commit]]" \
70 --set exclude='^misc\/.*|\.(ar|fa|id|pl|sr_Latn|tr|zh|zh_TW)\.po$' \
71 --include '^contribute\/how\/promote\/material\/.*' \
72 --set-yaml add_underlays="['${UNDERLAYS_DIR}/etcher-binary','${UNDERLAYS_DIR}/promotion-material']"
75 needs: [build-website, lint-po, check-website-core-pages, check-po-msgfmt, check-po-meta-date, check-translatable-live-website-urls]
77 - if: '$CI_COMMIT_BRANCH == "master"'
78 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/rsync:bookworm
81 environment: production
82 resource_group: production/$SSH_SERVER
85 - SSH_SERVER: www.lizard
87 - SSH_SERVER: www2.chameleon
90 - apt-get install -y openssh-client rsync
91 - test -e .ssh || mkdir .ssh
92 - cp "$WEBSITE_DEPLOY_SSH_PRIVATE_KEY" .ssh/private_key
93 - cp "$WEBSITE_DEPLOY_SSH_KNOWN_HOSTS" .ssh/known_hosts
94 - chmod 400 .ssh/known_hosts .ssh/private_key
95 - echo "variables often lack a trailing newline, which breaks SSH, detect and fix"
96 - ssh-keygen -y -f .ssh/private_key || echo >> .ssh/private_key
97 - echo "here is the SSH key we will deploy with"
98 - ssh-keygen -y -f .ssh/private_key
99 - echo -n "Begin rsync, time is " && date '+%Y-%m-%d %H-%M-%S%z'
100 - rsync --rsh="ssh -p ${SSH_PORT} -o UserKnownHostsFile=.ssh/known_hosts -i .ssh/private_key" --checksum --archive --no-times --verbose --mkpath --delete "config/chroot_local-includes/usr/share/doc/tails/website/" www-data@${SSH_SERVER}:/
103 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:trixie
105 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
111 - /tmp/jenkins-tools/slaves/lint_po
113 ruff-lint-changed-files:
121 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
124 - apt-get -qy install ruff findutils git python3
126 - git fetch origin "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
127 - ./bin/test-utils/ruff "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}" check --output-format=junit --output-file=ruff.xml
133 ruff-format-changed-files:
141 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
144 - apt-get -qy install ruff findutils git python3
146 - git fetch origin "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
147 - ./bin/test-utils/ruff "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}" format --check
149 check-website-core-pages:
151 - apt-get -qy install git
152 - ./bin/check-core-pages
156 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
161 - apt-get -qy install python3 gettext
162 - ./bin/check-po-msgfmt
166 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
171 - apt-get -qy install git ruby
172 - ./bin/sanity-check-website
174 check-translatable-live-website-urls:
176 - apt-get -qy install python3-polib
177 - ./bin/check-translatable-live-website-urls po/tails.pot
179 check-locale-descriptions:
181 - apt-get -qy install python3 python3-requests python3-toml python3-bs4
182 - echo 'If this fails, look at https://tails.net/contribute/release_process/update_locale_descriptions/'
183 - ./bin/locale-descriptions suggest
186 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:bookworm
188 - apt-get -qy install rubocop
190 - rubocop --format junit --out rubocop.xml --format markdown
198 - if: '$CI_COMMIT_BRANCH != "master"'
200 - './bin/test-utils/test-iuk'
204 - if: '$CI_COMMIT_BRANCH != "master"'
206 - 'cat config/chroot_local-packageslists/tails-perl5lib.list
208 | xargs apt-get -qy install'
209 - 'apt-get -qy install
211 libdist-zilla-plugin-test-notabs-perl
212 libdist-zilla-plugin-test-perl-critic-perl
213 libdist-zilla-app-command-authordebs-perl
216 - apt-get update -qq # Take into account APT configuration added by apt-file
217 # Otherwise, apt-get called by "dzil authordebs --install" asks confirmation
218 - echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/yes
219 - cd $CI_PROJECT_DIR/config/chroot_local-includes/usr/src/perl5lib
220 - dzil authordebs --install
224 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:trixie
226 - apt-get -qy install python3 shellcheck xmlstarlet git
227 - shellcheck --version
228 - 'git ls-files -z | ./bin/test-utils/is-file-type filter --zero shell | xargs --verbose --no-run-if-empty -0 shellcheck --format=checkstyle
229 | xmlstarlet tr config/ci/shellcheck/checkstyle2junit.xslt
234 junit: shellcheck.xml
244 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
247 - apt-get -qy install shfmt findutils git python3
249 - git fetch origin "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
250 - ./bin/test-utils/shfmt -s "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
252 test-persistent-storage-config-file:
254 - apt-get -qy install python3 python3-gi acl
255 - config/chroot_local-includes/usr/lib/python3/dist-packages/tps/configuration/config_file_test.py
259 - apt-get -qy install python3 python3-sh python3-toml python3-requests python3-bs4
260 - config/chroot_local-includes/usr/local/lib/tails-gdm-error-message doctest --verbose
261 - env PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages python3 config/chroot_local-includes/usr/local/bin/tails-documentation --doctest
262 - ./bin/locale-descriptions doctest
266 - if: '$CI_COMMIT_BRANCH != "master"'
268 - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
270 | xargs apt-get -qy install'
271 - 'cd config/chroot_local-includes/usr/lib/python3/dist-packages ; find tca -name "*.py" -print0 | xargs -0 -L1 env PYTHONPATH=. python3 -m doctest'
275 - if: '$CI_COMMIT_BRANCH != "master"'
277 - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
279 | xargs apt-get -qy install'
280 - 'PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages env python3 ./config/chroot_local-includes/usr/local/lib/tca-portal --doctest-only --log-level DEBUG'
285 - if: '$CI_COMMIT_BRANCH != "master"'
287 - apt-get -qy install python3 python3-atomicwrites python3-sh python3-gi git
288 - 'cd config/chroot_local-includes/usr/lib/python3/dist-packages ; find tailslib -name "*.py" -print0 | grep --null-data -v -e netnsdrop.py -e gnome.py | xargs -0 -L1 env PYTHONPATH=. python3 -m doctest'
292 - if: '$CI_COMMIT_BRANCH != "master"'
294 - 'cat config/chroot_local-packageslists/whisperback.list | grep -E -v "^#"
295 | xargs apt-get -qy install'
296 - apt-get -qy install python3-pytest
297 - 'PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages
298 pytest-3 --verbose --junit-xml=report.xml
299 config/chroot_local-includes/usr/lib/python3/dist-packages/whisperBack/test.py'
305 apt-snapshots-expiry:
307 - apt-get -qy install curl git
308 - ./bin/apt-snapshots-expiry
310 - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
313 - config/APT_snapshots.d/*/serial
314 - vagrant/definitions/tails-builder/config/APT_snapshots.d/*/serial
316 .install-https-get-expired-build-deps: &install-https-get-expired-build-deps
317 - apt-get -qy install --no-install-recommends golang-go ca-certificates
319 .build-https-get-expired: &build-https-get-expired
320 - go build -o ./https-get-expired config/chroot_local-includes/usr/src/https-get-expired.go
322 .test-https-get-expired: &test-https-get-expired
323 - echo "Basic check:"
324 - ./https-get-expired -reject-expired https://tails.net/
325 - echo "Let's pretend we are in the past. Then, this certificate is still good."
326 - ./https-get-expired -current-time 2000-01-01 -reject-expired https://tails.net/
327 - echo "Let's pretend we are in the future. Then, this certificate is expired"
328 - "! ./https-get-expired -current-time 2090-01-01 -reject-expired https://tails.net/"
329 - "! ./https-get-expired -reject-expired https://wrong.host.badssl.com/"
330 - "! ./https-get-expired -reject-expired https://self-signed.badssl.com/"
331 - "! ./https-get-expired -reject-expired https://untrusted-root.badssl.com/"
332 - "! ./https-get-expired -reject-expired https://expired.badssl.com/"
333 - echo "Invalid host"
334 - "! ./https-get-expired -reject-expired https://nxdomain.tails.net/"
335 - "./bin/test-utils/https-get-expired-test-all"
339 - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
342 - config/chroot_local-includes/usr/src/https-get-expired.go
343 - config/chroot_local-includes/etc/default/htpdate.pools
345 - *install-https-get-expired-build-deps
346 - *build-https-get-expired
347 - *test-https-get-expired
349 https-get-expired-sid:
350 # this job gives us results using a future version of Golang compared to the one we actually use
351 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
353 - if: '$CI_COMMIT_BRANCH == "devel"'
356 - config/chroot_local-includes/usr/src/https-get-expired.go
357 - config/chroot_local-includes/etc/default/htpdate.pools
359 - *install-https-get-expired-build-deps
360 - *build-https-get-expired
361 - *test-https-get-expired