Skip to content
Snippets Groups Projects
Commit 1eafffed authored by hglawe's avatar hglawe
Browse files

Merge branch 'add-debian-packaging-ci' into 'main'

Add debian packaging ci

See merge request !22
parents 5de92bcb ffdd0ffe
No related branches found
No related tags found
1 merge request!22Add debian packaging ci
...@@ -3,23 +3,42 @@ image: python:latest ...@@ -3,23 +3,42 @@ image: python:latest
stages: stages:
- test-style - test-style
- test - test
- package
.install_python_dependencies:
before_script:
- cat /etc/issue
- python3 -V
- which python3
- python3 -m venv ../venv
- source ../venv/bin/activate
- which python3
- pwd
- pip install -U pip
- pip install ."[dev]"
- mpsd-quota --version
- mpsd-quota --help
.install_build_dependencies:
before_script:
- cat /etc/issue
- export DEBEMAIL="gitlab_ci@domain.com"
- export DEBFULLNAME="Gitlab Runner"
- echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list
- apt-get update && apt-get install -y build-essential python3-all python3-dev python3-venv python3-wheel python3-setuptools python3-pip zip
- apt-get install -y binutils lintian debhelper dh-make devscripts dh-python pbuilder
- apt-get install -y fakeroot dpkg-dev aptitude
- python3 -V
- which python3
- pwd
- ls -la
before_script:
- cat /etc/issue
- python -V
- which python
- python -m venv ../venv
- source ../venv/bin/activate
- which python
- pwd
- pip install -U pip
- pip install ."[dev]"
- mpsd-quota --version
style: style:
stage: test-style stage: test-style
image: python:latest image: python:latest
extends: .install_python_dependencies
script: script:
- black --version - black --version
- ruff --version - ruff --version
...@@ -30,18 +49,21 @@ style: ...@@ -30,18 +49,21 @@ style:
test3-09: test3-09:
stage: test stage: test
image: python:3.9 image: python:3.9
extends: .install_python_dependencies
script: script:
- make test+coverage - make test+coverage
test3-10: test3-10:
stage: test stage: test
image: python:3.10 image: python:3.10
extends: .install_python_dependencies
script: script:
- make test+coverage - make test+coverage
test3-11: test3-11:
stage: test stage: test
image: python:3.11 image: python:3.11
extends: .install_python_dependencies
script: script:
- make test+coverage - make test+coverage
...@@ -50,5 +72,22 @@ test3-11: ...@@ -50,5 +72,22 @@ test3-11:
typing: typing:
stage: test-style stage: test-style
image: python:latest image: python:latest
extends: .install_python_dependencies
script: script:
- make typing || /bin/true - make typing || /bin/true
# package debian package
package:
stage: package
image: debian:bullseye
extends: .install_build_dependencies
script:
- make deb-package-ci
- ls -lah ../
- mkdir -p artifact
- cp ../mpsd-hpc-tools_* artifact
- zip -r artifacts.zip artifact/*
artifacts:
paths:
- artifacts.zip
expire_in: 1 week
...@@ -19,3 +19,10 @@ test+coverage: ...@@ -19,3 +19,10 @@ test+coverage:
typing: typing:
@# run static typing check - can reveal bugs / lack of clarity @# run static typing check - can reveal bugs / lack of clarity
mypy . mypy .
deb-package-ci:
@# build a debian package using dpkg-buildpackage
/usr/lib/pbuilder/pbuilder-satisfydepends
dpkg-buildpackage --no-sign -sa
mpsd-hpc-tools (2023.6.19) UNRELEASED; urgency=medium
* updated interface ( no --user )
-- Henning Glawe <glaweh@debian.org> Wed, 21 Jun 2023 13:54:53 +0200
mpsd-hpc-tools (2023.4.27) mpsd-bullseye; urgency=medium mpsd-hpc-tools (2023.4.27) mpsd-bullseye; urgency=medium
* Initial release * Initial release
......
...@@ -72,7 +72,9 @@ Building Debian package ...@@ -72,7 +72,9 @@ Building Debian package
----------------------- -----------------------
In the package root directory, run `dpkg-buildpackage --no-sign -sa`. After successful build the package can be found in the parent directory and installed using `dpgk -i ../mpsd-hpc-tools_<version>_all.deb`. In the package root directory, run `dpkg-buildpackage --no-sign -sa`. After successful build the package can be found in the parent directory and installed using `dpgk -i ../mpsd-hpc-tools_<version>_all.deb`.
By default, every MR will trigger a build of the package in the CI pipeline. The `.deb` package will be uploaded to the repository as an artifact at the end of the pipeline.
The latest build artifact can be found at `https://gitlab.gwdg.de/mpsd-cs/mpsd-hpc-tools/-/jobs/artifacts/main/raw/artifacts.zip?job=package`.
Remember that every time package version is changed, the `debian/changelog` file needs to be updated accordingly.
Versioning Versioning
---------- ----------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment