Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 5378bd3e authored by FAURE Adrien's avatar FAURE Adrien Committed by FAURE Adrien
Browse files

ci for debian packaging

parent b3220808
No related branches found
No related tags found
No related merge requests found
Pipeline #466046 passed
default:
stages:
- test
- debian-build
- release
.default:
image: python:${PYTHON_VERSION}-slim-${DEBIAN_VERSION}
before_script:
- python --version
......@@ -7,6 +12,8 @@ default:
pytest:
stage: test
image: !reference [.default,image]
before_script: !reference [.default,before_script]
script:
- pytest --cov-report=term-missing --junitxml=pytest.xml
coverage: '/^TOTAL.+ ([1-9]?[0-9]%|100%)$/'
......@@ -21,3 +28,61 @@ pytest:
DEBIAN_VERSION: ['stretch', 'buster', 'bullseye']
- PYTHON_VERSION: ['3.8', '3.9', '3.10']
DEBIAN_VERSION: ['buster', 'bullseye']
create-debian-packages:
image: debian:$DEBIAN_VERSION
stage: debian-build
rules:
- if: $CI_COMMIT_BRANCH =~ /^debian.*$/
- if: $CI_COMMIT_TAG =~ /^debian\/.*$/
variables:
DEBIAN_VERSION: "bookworm"
DEBIAN_FRONTEND: "noninteractive"
DEBIAN_PRIORITY: "critical"
DEBCONF_NOWARNINGS: "yes"
before_script:
- apt-get update
- apt-get -y install git
- apt-get -y install dpkg-dev fakeroot lintian python3-sphinx python-all debhelper po-debconf dh-make python3-all python3-setuptools dh-python python3-sphinx-rtd-theme tree
# Get the tag name, or the commit
- COMMIT_OR_TAG="${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
# Remove / from the tagname as it is used in file name later
- export COMMIT_OR_TAG=$(echo $COMMIT_OR_TAG | sed 's#/#-#g')
# Save this variable for the release job
- echo "COMMIT_OR_TAG=$COMMIT_OR_TAG" >> job.env
script:
# Building the debian package.
- dpkg-buildpackage -b -rfakeroot -us -uc
- mv ../*.deb ../*.buildinfo ../*.changes . && tar cvf procset-${COMMIT_OR_TAG}.tar.gz *.deb *.buildinfo *.changes
after_script:
- echo "JOB_ID=$CI_JOB_ID" >> job.env
artifacts:
paths:
# Since I can't use the variable create in *_script here, I use a wildcard
- procset-*.tar.gz
expire_in: never
reports:
dotenv: job.env
# Release job for the debian package, it relies on the artifacts of create-debian-packages.
release-for-debian:
stage: release
rules:
- if: $CI_COMMIT_TAG =~ /^debian\/.*$/
needs:
# We want the test to pass
- job: pytest
- job: create-debian-packages
artifacts: true
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo 'running release_job for $CI_COMMIT_TAG'
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Created using the release-cli'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_TAG'
assets:
links:
- name: procset-${COMMIT_OR_TAG}.tar.gz
url: https://gitlab.inria.fr/adfaure/procset.py/-/jobs/${JOB_ID}/artifacts/raw/procset-${COMMIT_OR_TAG}.tar.gz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment