Skip to content
Snippets Groups Projects
Commit 068224b4 authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- init: debian packaging

parent 1d683662
No related branches found
No related tags found
No related merge requests found
Pipeline #4982 failed
...@@ -19,13 +19,46 @@ ...@@ -19,13 +19,46 @@
image: sdvharbor.slub-dresden.de/replication/debian:bookworm-slim image: sdvharbor.slub-dresden.de/replication/debian:bookworm-slim
before_script: before_script:
- apt-get update - apt-get update && \
- apt-get -y install shellcheck apt-get dist-upgrade -y && \
apt-get autoremove -y && \
apt-get install -y dpkg git sed shellcheck
stages: # List of stages for jobs, and their order of execution stages: # List of stages for jobs, and their order of execution
- test - test
- packaging
test-job: # This job runs in the test stage. test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully. stage: test # It only starts when the job in the build stage completes successfully.
script: script:
- shellcheck --color=always --shell=bash --enable=all --exclude=SC2317 "validate_workflow.sh" - shellcheck --color=always --shell=bash --enable=all --exclude=SC2317 "validate_workflow.sh"
packaging-job:
stage: packaging
timeout: 5m
script:
# HINT: current working dir == '/builds/digital-preservation/validate_workflows' as root
# retrieve version infos
- REVISION="1"
- BRANCH="$(([ -z "${CI_COMMIT_BRANCH}" ] && echo ${CI_COMMIT_TAG} || echo ${CI_COMMIT_BRANCH}) | sed "s#[^A-Za-z0-9\.~+-]##g")" # use tag name in tag pipelines, filter characters based on https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version
- VERSION="$(git rev-list HEAD --count)-${BRANCH}"
- ARCHITECTURE="all"
# create build dir structure
- DEB_BUILD_DIR="slubarchiv-xml-catalog_${VERSION}-${REVISION}_${ARCHITECTURE}"
- mkdir -p ${DEB_BUILD_DIR}/DEBIAN
# copy project files to be packaged
- cp src/* ${DEB_BUILD_DIR}/
# copy & rename deb control file template
- cp gitlab-ci/validate_workflows.control ${DEB_BUILD_DIR}/DEBIAN/control
# set package version
- sed -i "s#VERSION_PLACEHOLDER#$VERSION-$REVISION#g" ${DEB_BUILD_DIR}/DEBIAN/control
# add checksums
- pushd ${DEB_BUILD_DIR}
- md5sum $(find * -type f -not -path 'DEBIAN/*') > DEBIAN/md5sums
- popd
# build binary deb package
- dpkg-deb --build --root-owner-group ${DEB_BUILD_DIR}/
artifacts:
paths:
# package name: validate-workflows_[VERSION]-[REVISION]_[ARCHITECTURE].deb
- "*.deb"
\ No newline at end of file
Package: validate_workflows
Version: VERSION_PLACEHOLDER
Architecture: all
Maintainer: SLUBArchiv.digital <langzeitarchiv@slub-dresden.de>
Description: This is a meta tool to validate files based on specified SLUBArchiv.digital recommendations.
Homepage: https://git.slub-dresden.de/digital-preservation/validate_workflows
Section: main
Priority: optional
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment