Newer
Older
include:
- project: 'infra/packages/ci-utils'
ref: main
file: 'shared-ci.yml'
variables:
# We don't set PACKAGE_NAME since we build many different packages,
# therefore we must overwrite APT_REPO.
APT_REPO: infrapackages-dokuwiki
autoupdate:
stage: autoupdate
rules:
- if: '$RUN_AUTOUPDATE == "1"'
when: always
dependencies: []
needs: []
script:
- mkdir -p ~/.ssh && chmod 0700 ~/.ssh && echo "$SSH_DEPLOY_KEY" > ~/.ssh/id_ed25519 && chmod 0600 ~/.ssh/id_ed25519
- echo "$SSH_HOST_KEY" > ~/.ssh/known_hosts
- git clone "git@${CI_SERVER_SHELL_SSH_HOST}:${CI_PROJECT_PATH}.git" autoupdate-checkout
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- |
set -e
cd autoupdate-checkout
git config --global user.email "infra+packages-autoupdate@cccv.de"
git config --global user.name "autoupdater"
mkdir ../tmp
grep -E '^[^#]+' config/plugins | while read -r plugin_name plugin_url; do
plugin_path="$(pwd)/tmp/${plugin_name}"
git clone --depth 1 "${plugin_url}" "${plugin_path}"
plugin_version="$(git -C "${plugin_path}" show -s --date='format:%Y%m%d' --format='0.0.%cd+git%h' HEAD)"
tag_name="release/${plugin_name}/${plugin_version}"
tag_filter="release/${plugin_name}/${plugin_version%+*}+*"
if [ "$(git tag -l "$tag_filter")" == "" ]; then
git tag "${tag_name}"
git push --tags
fi
done
package:apt:bullseye:
stage: package
rules:
- if: '$RUN_AUTOUPDATE != "1" && $CI_COMMIT_TAG =~ /^release\//'
script:
- ./scripts/prepare_package.sh "${CI_COMMIT_TAG#release/}"
- dpkg-buildpackage -us -uc
- mv ../*.deb ./
- dpkg-deb -I *.deb
- dpkg-deb -c *.deb > contents.txt
artifacts:
paths:
- ./*.deb
- debian
- contents.txt
publish:apt:buster:
extends: .publish:apt
variables:
APTLY_DISTRO: buster
APTLY_ARCH: all
dependencies:
- package:apt:bullseye
needs:
- package:apt:bullseye
publish:apt:bullseye:
extends: .publish:apt
variables:
APTLY_DISTRO: bullseye
APTLY_ARCH: all
dependencies:
- package:apt:bullseye
needs:
- package:apt:bullseye