diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 002efc2b74b287eecf3c85a0283e583629c9e363..0e3e098194a7bbf0ebf38cb67dc51e1303b50128 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,23 +3,42 @@ image: python:latest stages: - test-style - 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: stage: test-style image: python:latest + extends: .install_python_dependencies script: - black --version - ruff --version @@ -30,18 +49,21 @@ style: test3-09: stage: test image: python:3.9 + extends: .install_python_dependencies script: - make test+coverage test3-10: stage: test image: python:3.10 + extends: .install_python_dependencies script: - make test+coverage test3-11: stage: test image: python:3.11 + extends: .install_python_dependencies script: - make test+coverage @@ -50,5 +72,22 @@ test3-11: typing: stage: test-style image: python:latest + extends: .install_python_dependencies script: - 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 diff --git a/Makefile b/Makefile index 0d2fbcdfe23d3b6e2618102c51edda41e14593a6..9e7b329febc8c583f40edc6d6c7d4022908919e5 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,10 @@ test+coverage: typing: @# run static typing check - can reveal bugs / lack of clarity mypy . + +deb-package-ci: + @# build a debian package using dpkg-buildpackage + /usr/lib/pbuilder/pbuilder-satisfydepends + dpkg-buildpackage --no-sign -sa + + diff --git a/debian/changelog b/debian/changelog index 541e5ee7e207e191304632a0a90c2ff8e445700c..0ea49ae769466605150b3ee14e66cf08e55fbc3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +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 * Initial release diff --git a/development.rst b/development.rst index 2bcefe39a71914694fd8e4194d23a8cdb9676aad..394a0ef50c51f93d5f66fbcf72ecf35954b1fecf 100644 --- a/development.rst +++ b/development.rst @@ -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`. - +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 ----------