9 - if: $CI_MERGE_REQUEST_IID
11 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
13 # Please, make sure to only use images from `registry.gitlab.tails.boum.org`,
14 # as we give significant privileges to our Runners wrt. what they can do in our
16 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:bookworm
19 GET_SOURCES_ATTEMPTS: 10
22 - export DEBIAN_FRONTEND=noninteractive
25 .prepare-lint-po: &prepare-lint-po
26 - apt-get -qy install git i18nspector
27 - git clone https://gitlab.tails.boum.org/tails/jenkins-tools.git /tmp/jenkins-tools
32 - if: '$CI_COMMIT_BRANCH == "master"'
34 IKIWIKI_RCS_OPTION: --rcs git
35 - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
38 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/ikiwiki:bookworm
40 key: website-$CI_COMMIT_REF_SLUG
42 - config/chroot_local-includes/usr/share/doc/tails/website
48 - config/chroot_local-includes/usr/share/doc/tails/website
52 UNDERLAYS_DIR: ${CI_PROJECT_DIR}/underlays
54 - mkdir -p ${UNDERLAYS_DIR}
56 for i in etcher-binary promotion-material; do
57 test -d ${UNDERLAYS_DIR}/${i} || git clone --depth=1 https://gitlab.tails.boum.org/tails/${i}.git ${UNDERLAYS_DIR}/${i}
58 git -C ${UNDERLAYS_DIR}/${i} switch master
59 git -C ${UNDERLAYS_DIR}/${i} pull
62 if [ "$CI_COMMIT_BRANCH" == "master" ]; then
63 git checkout -B master $CI_COMMIT_SHA
64 git branch -u origin/master
65 git remote set-url origin https://user:$WEBSITE_BUILD_PROJECT_ACCESS_TOKEN@gitlab.tails.boum.org/tails/tails.git
68 ./build-website ${IKIWIKI_RCS_OPTION} \
69 --url "https://tails.net" \
72 --historyurl "https://gitlab.tails.boum.org/tails/tails/-/commits/master/wiki/src/[[file]]" \
73 --diffurl "https://gitlab.tails.boum.org/tails/tails/-/commit/[[sha1_commit]]" \
76 --set exclude='^misc\/.*|\.(ar|fa|id|pl|sr_Latn|tr|zh|zh_TW)\.po$' \
77 --include '^contribute\/how\/promote\/material\/.*' \
78 --set-yaml add_underlays="['${UNDERLAYS_DIR}/etcher-binary','${UNDERLAYS_DIR}/promotion-material']"
83 - if: '$CI_COMMIT_BRANCH == "master"'
84 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/rsync:bookworm
87 environment: production
88 resource_group: production/$SSH_SERVER
91 - SSH_SERVER: www.lizard
93 - SSH_SERVER: www2.chameleon
96 - apt-get install -y openssh-client rsync
97 - test -e .ssh || mkdir .ssh
98 - cp "$WEBSITE_DEPLOY_SSH_PRIVATE_KEY" .ssh/private_key
99 - cp "$WEBSITE_DEPLOY_SSH_KNOWN_HOSTS" .ssh/known_hosts
100 - chmod 400 .ssh/known_hosts .ssh/private_key
101 - echo "variables often lack a trailing newline, which breaks SSH, detect and fix"
102 - ssh-keygen -y -f .ssh/private_key || echo >> .ssh/private_key
103 - echo "here is the SSH key we will deploy with"
104 - ssh-keygen -y -f .ssh/private_key
105 - echo -n "Begin rsync, time is " && date '+%Y-%m-%d %H-%M-%S%z'
106 - 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}:/
109 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:trixie
111 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
117 - /tmp/jenkins-tools/slaves/lint_po
119 ruff-lint-changed-files:
127 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
130 - apt-get -qy install ruff findutils git python3
132 - git fetch origin "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
133 - ./bin/test-utils/ruff "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}" check --output-format=junit --output-file=ruff.xml
139 ruff-format-changed-files:
147 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
150 - apt-get -qy install ruff findutils git python3
152 - git fetch origin "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}"
153 - ./bin/test-utils/ruff "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:?}" format --check
155 check-website-core-pages:
157 - apt-get -qy install git
158 - ./bin/check-core-pages
162 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
167 - apt-get -qy install python3 gettext
168 - ./bin/check-po-msgfmt
172 - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
177 - apt-get -qy install git ruby
178 - ./bin/sanity-check-website
180 check-translatable-live-website-urls:
182 - apt-get -qy install python3-polib
183 - ./bin/check-translatable-live-website-urls po/tails.pot
185 check-locale-descriptions:
187 - apt-get -qy install python3 python3-requests python3-toml python3-bs4
188 - echo 'If this fails, look at https://tails.net/contribute/release_process/update_locale_descriptions/'
189 - ./bin/locale-descriptions suggest
192 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:bookworm
194 - apt-get -qy install rubocop
196 - rubocop --format junit --out rubocop.xml --format markdown
204 - if: '$CI_COMMIT_BRANCH != "master"'
206 - './bin/test-utils/test-iuk'
210 - if: '$CI_COMMIT_BRANCH != "master"'
212 - 'cat config/chroot_local-packageslists/tails-perl5lib.list
214 | xargs apt-get -qy install'
215 - 'apt-get -qy install
217 libdist-zilla-plugin-test-notabs-perl
218 libdist-zilla-plugin-test-perl-critic-perl
219 libdist-zilla-app-command-authordebs-perl
222 - apt-get update -qq # Take into account APT configuration added by apt-file
223 # Otherwise, apt-get called by "dzil authordebs --install" asks confirmation
224 - echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/yes
225 - cd $CI_PROJECT_DIR/config/chroot_local-includes/usr/src/perl5lib
226 - dzil authordebs --install
230 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:trixie
232 - apt-get -qy install python3 shellcheck xmlstarlet git
233 - shellcheck --version
234 - 'git ls-files -z | ./bin/test-utils/is-file-type filter --zero shell | xargs --verbose --no-run-if-empty -0 shellcheck --format=checkstyle
235 | xmlstarlet tr config/ci/shellcheck/checkstyle2junit.xslt
240 junit: shellcheck.xml
242 test-persistent-storage-config-file:
244 - apt-get -qy install python3 python3-gi acl
245 - config/chroot_local-includes/usr/lib/python3/dist-packages/tps/configuration/config_file_test.py
249 - apt-get -qy install python3 python3-sh python3-toml python3-requests python3-bs4
250 - config/chroot_local-includes/usr/local/lib/tails-gdm-error-message doctest --verbose
251 - env PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages python3 config/chroot_local-includes/usr/local/bin/tails-documentation --doctest
252 - ./bin/locale-descriptions doctest
256 - if: '$CI_COMMIT_BRANCH != "master"'
258 - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
260 | xargs apt-get -qy install'
261 - 'cd config/chroot_local-includes/usr/lib/python3/dist-packages ; find tca -name "*.py" -print0 | xargs -0 -L1 env PYTHONPATH=. python3 -m doctest'
265 - if: '$CI_COMMIT_BRANCH != "master"'
267 - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
269 | xargs apt-get -qy install'
270 - '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'
275 - if: '$CI_COMMIT_BRANCH != "master"'
277 - apt-get -qy install python3 python3-atomicwrites python3-sh python3-gi git
278 - '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'
282 - if: '$CI_COMMIT_BRANCH != "master"'
284 - 'cat config/chroot_local-packageslists/whisperback.list | grep -E -v "^#"
285 | xargs apt-get -qy install'
286 - apt-get -qy install python3-pytest
287 - 'PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages
288 pytest-3 --verbose --junit-xml=report.xml
289 config/chroot_local-includes/usr/lib/python3/dist-packages/whisperBack/test.py'
295 apt-snapshots-expiry:
297 - apt-get -qy install curl git
298 - ./bin/apt-snapshots-expiry
300 - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
303 - config/APT_snapshots.d/*/serial
304 - vagrant/definitions/tails-builder/config/APT_snapshots.d/*/serial
306 .install-https-get-expired-build-deps: &install-https-get-expired-build-deps
307 - apt-get -qy install --no-install-recommends golang-go ca-certificates
309 .build-https-get-expired: &build-https-get-expired
310 - go build -o ./https-get-expired config/chroot_local-includes/usr/src/https-get-expired.go
312 .test-https-get-expired: &test-https-get-expired
313 - echo "Basic check:"
314 - ./https-get-expired -reject-expired https://tails.net/
315 - echo "Let's pretend we are in the past. Then, this certificate is still good."
316 - ./https-get-expired -current-time 2000-01-01 -reject-expired https://tails.net/
317 - echo "Let's pretend we are in the future. Then, this certificate is expired"
318 - "! ./https-get-expired -current-time 2090-01-01 -reject-expired https://tails.net/"
319 - "! ./https-get-expired -reject-expired https://wrong.host.badssl.com/"
320 - "! ./https-get-expired -reject-expired https://self-signed.badssl.com/"
321 - "! ./https-get-expired -reject-expired https://untrusted-root.badssl.com/"
322 - "! ./https-get-expired -reject-expired https://expired.badssl.com/"
323 - echo "Invalid host"
324 - "! ./https-get-expired -reject-expired https://nxdomain.tails.net/"
325 - "./bin/test-utils/https-get-expired-test-all"
329 - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
332 - config/chroot_local-includes/usr/src/https-get-expired.go
333 - config/chroot_local-includes/etc/default/htpdate.pools
335 - *install-https-get-expired-build-deps
336 - *build-https-get-expired
337 - *test-https-get-expired
339 https-get-expired-sid:
340 # this job gives us results using a future version of Golang compared to the one we actually use
341 image: registry.gitlab.tails.boum.org/sysadmin-team/container-images/debian:sid
343 - if: '$CI_COMMIT_BRANCH == "devel"'
346 - config/chroot_local-includes/usr/src/https-get-expired.go
347 - config/chroot_local-includes/etc/default/htpdate.pools
349 - *install-https-get-expired-build-deps
350 - *build-https-get-expired
351 - *test-https-get-expired