Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
et-iedo-public
debian-packages
gitlab-package-build
Commits
dc5cbfd4
Commit
dc5cbfd4
authored
Dec 10, 2021
by
Adam Lewenberg
Browse files
more work
parent
5e7149c2
Pipeline
#31673
passed with stages
in 6 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
dc5cbfd4
# 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
debian/changelog
View file @
dc5cbfd4
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.
...
...
generate-yaml.sh
View file @
dc5cbfd4
...
...
@@ -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
gitlab-ci.yml.template
View file @
dc5cbfd4
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment