Commit dc5cbfd4 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

more work

parent 5e7149c2
Pipeline #31673 passed with stages
in 6 seconds
# Build a Debian package using GitLab CI/CD
TBD
## Building for distributions
If you are planning to upload the builds, yo uneed to do the builds
separately
1. Set `DEBIAN_DISTROS` to the distribution
test-package-build (5~sbp10+11) buster; urgency=medium
* backport to buster
-- Adam Henry Lewenberg <adamhl@stanford.edu> Fri, 10 Dec 2021 09:21:31 -0800
test-package-build (5) unstable; urgency=medium
* More testing.
......
......@@ -15,16 +15,48 @@ set -e
# that is the used by a child pipline via a trigger. See the file
# .gitlab-ci.yaml in this directory for an example.
if [[ -z "$DEBIAN_DISTROS" ]]; then
DEBIAN_DISTROS="sid buster bullseye"
# Define the current Debian distrubtion and codename mappings.
declare -A release_to_suite
release_to_suite['bullseye']='stable'
release_to_suite['buster']='oldstable'
release_to_suite['stretch']='oldoldstable'
declare -A release_to_number
release_to_number['stretch']='9'
release_to_number['buster']='10'
release_to_number['bullseye']='11'
if [[ -z "$DEBIAN_RELEASES" ]]; then
DEBIAN_RELEASES="sid buster bullseye"
fi
cat header.yml
for DISTRO in $DEBIAN_DISTROS
# Generate the "stages" section so that the builds
# run serially. This is not a technical requirement, rather
# it is being polite so we don't hog the build resources.
echo "stages:"
for RELEASE in $DEBIAN_RELEASES
do
echo "- $RELEASE"
done
echo
for RELEASE in $DEBIAN_RELEASES
do
if [[ "$RELEASE" == "sid" ]]; then
DCH_COMMAND="echo 'skipping dch since this is build for unstable (sid)'"
else
message="Stanford backport to $RELEASE."
relnumber=${release_to_number[$RELEASE]}
suite=${release_to_suite[$RELEASE]}
localver="~sbp$relnumber+1"
DCH_COMMAND="dch --local=$localver --distribution=$suite '$message'"
fi
cat gitlab-ci.yml.template \
| sed "s/%%DEBIAN_DISTRIBUTION%%/$DISTRO/g" \
| sed "s/%%DEBIAN_RELEASE%%/$RELEASE/g" \
| sed "s/%%DCH_COMMAND%%/$DCH_COMMAND/g" \
| sed "s/%%DPUT_HOST%%/$DPUT_HOST/g"
echo
done
# Build a %%DEBIAN_DISTRIBUTION%% Debian package.
# Build a %%DEBIAN_RELEASE%% Debian package.
# We create the directory build-area/ to put the Debian build output.
build-debian-package-%%DEBIAN_DISTRIBUTION%%:
build-debian-package-%%DEBIAN_RELEASE%%:
stage: %%DEBIAN_RELEASE%%
image:
name: $DOCKER_DEB_PACKAGE_BUILDER:%%DEBIAN_DISTRIBUTION%%
name: $DOCKER_DEB_PACKAGE_BUILDER:%%DEBIAN_RELEASE%%
entrypoint: ["/bin/bash"]
script:
- echo $SSH_PRIVATE_KEY_PATH
- echo "fixing permissions on private key file..."
- chmod 600 $SSH_PRIVATE_KEY_PATH
- ls -l $SSH_PRIVATE_KEY_PATH
- echo "adding backport changelog entry"
- %%DCH_COMMAND%%
- ls -lrta ..
- pwd
- ls -lrta
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment