Compare commits

...

4 commits

Author SHA1 Message Date
Benjamin Renard ef94f4dd70
Release 4.2.0-1 2023-10-26 14:23:30 +02:00
Benjamin Renard 717d424f76
CI: fully specified image names 2023-10-26 14:23:00 +02:00
Benjamin Renard 982d29aa63
CI: publish a new release in Gitlab on new tag 2023-10-26 14:20:40 +02:00
Benjamin Renard f6fa5a2d96
CI: add build & publish step for debian stable package 2023-10-26 12:52:19 +02:00
4 changed files with 129 additions and 14 deletions

View file

@ -2,15 +2,17 @@ stages:
- tests
- build
- publish
- release
variables:
DOC_BRANCH: doc
DOC_REMOTE: https://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}"
tests:bookworm:
image:
name: brenard/ldapsaisie:bookworm
name: docker.io/brenard/ldapsaisie:bookworm
entrypoint: [""]
stage: tests
rules:
@ -35,7 +37,7 @@ tests:bookworm:
tests:bullseye:
image:
name: brenard/ldapsaisie:bullseye
name: docker.io/brenard/ldapsaisie:bullseye
entrypoint: [""]
stage: tests
rules:
@ -60,7 +62,7 @@ tests:bullseye:
tests:buster:
image:
name: brenard/ldapsaisie:buster
name: docker.io/brenard/ldapsaisie:buster
entrypoint: [""]
stage: tests
rules:
@ -86,7 +88,7 @@ tests:buster:
tests:stretch:
image:
name: brenard/ldapsaisie:stretch
name: docker.io/brenard/ldapsaisie:stretch
entrypoint: [""]
stage: tests
rules:
@ -101,7 +103,7 @@ tests:stretch:
tests:jessie:
image:
name: brenard/ldapsaisie:jessie
name: docker.io/brenard/ldapsaisie:jessie
entrypoint: [""]
stage: tests
rules:
@ -114,8 +116,24 @@ tests:jessie:
- rm -f .phplint-cache
- /tmp/vendor/bin/phplint src
build:debian-stable:
image: docker.io/brenard/debian-python-deb:debian11
stage: build
cache:
paths:
- .cache/pip
rules:
- if: $CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == "master"
script:
- ./build-deb.sh --install-build-deps
- rm -fr dist/ldapsaisie-*
- dpkg-parsechangelog --format dpkg|awk '/ ldapsaisie /,0'|tail -n +3 > dist/release-notes.md
artifacts:
paths:
- dist/*
build:debian-sid:
image: brenard/debian-python-deb:debian11
image: docker.io/brenard/debian-python-deb:debian11
stage: build
cache:
paths:
@ -131,7 +149,7 @@ build:debian-sid:
build:snapshot:
stage: build
image: alpine
image: docker.io/alpine
only:
- master
script:
@ -142,7 +160,7 @@ build:snapshot:
build:doc:html:
stage: build
image: python:alpine
image: docker.io/python:alpine
cache:
paths:
- .cache/pip
@ -173,7 +191,7 @@ build:doc:html:
build:doc:pdf:
stage: build
image:
name: pink33n/html-to-pdf
name: docker.io/pink33n/html-to-pdf
entrypoint: ["/bin/sh", "-c"]
only:
- master
@ -189,7 +207,7 @@ build:doc:pdf:
build:doc:epub:
stage: build
image:
name: pandoc/core
name: docker.io/pandoc/core
entrypoint: ["/bin/sh", "-c"]
only:
- master
@ -207,7 +225,7 @@ build:doc:epub:
build:doc:append_additional_versions:
stage: build
image: python:alpine
image: docker.io/python:alpine
only:
- master
needs:
@ -232,7 +250,7 @@ build:doc:append_additional_versions:
publish:doc:
stage: publish
image: alpine:latest
image: docker.io/alpine:latest
only:
- master
needs:
@ -252,7 +270,7 @@ publish:doc:
publish:snapshot:
stage: publish
image: alpine:latest
image: docker.io/alpine:latest
only:
- master
needs:
@ -266,9 +284,44 @@ publish:snapshot:
script:
- rsync -atv ldapsaisie-snapshot.tar.gz $SSH_USER@$SSH_HOST:download/ldapsaisie-snapshot.tar.gz
publish:debian-stable:
stage: publish
image: docker.io/debian:stable-slim
needs:
- build:debian-stable
rules:
- if: $CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == "master"
before_script:
- apt-get update
- apt-get install -y --no-install-recommends rsync openssh-client dupload
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add -
- mkdir ~/.ssh
- echo "$SSH_HOST_KEY" | base64 -d > ~/.ssh/known_hosts
- echo "$DUPLOAD_CONFIG" | base64 -d > ~/.dupload.conf
script:
- echo "Publish stable debian packages on APT repository..."
- dupload --to debian-stable dist/ldapsaisie*changes
publish:gitlab:
stage: publish
image:
name: docker.io/alpine/httpie
entrypoint: ["/bin/sh", "-c"]
needs:
- build:debian-stable
rules:
- if: $CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == "master"
script:
- ./.gitlab/publish.sh
artifacts:
paths:
- dist/release-notes.md
- dist/release-files.txt
publish:debian-sid:
stage: publish
image: debian:stable-slim
image: docker.io/debian:stable-slim
only:
- master
needs:
@ -284,3 +337,15 @@ publish:debian-sid:
script:
- echo "Publish Sid debian packages on APT repository..."
- dupload --to debian-sid dist/ldapsaisie*changes
release:
stage: release
image:
name: registry.gitlab.com/gitlab-org/release-cli:latest
entrypoint: ["/bin/sh", "-c"]
needs:
- publish:gitlab
rules:
- if: $CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == "master"
script:
- ./.gitlab/release.sh

14
.gitlab/publish.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
cd `dirname $0`/../dist
rm -f release-files.txt
touch release-files.txt
for file in *.deb
do
# The filename can contain only lowercase letters (a-z), uppercase letter (A-Z), numbers (0-9), dots (.),
# hyphens (-), or underscores (_).
filename=`echo $file|tr '~' '_'|tr '+' '_'|sed s/[^a-zA-Z0-9\.\_\-]//g`
https --ignore-stdin --check-status PUT "${PACKAGE_REGISTRY_URL}/${filename}" "JOB-TOKEN: $CI_JOB_TOKEN" "@$file"
echo $filename >> release-files.txt
done

14
.gitlab/release.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
echo "Creating a release for $CI_COMMIT_TAG"
cd `dirname $0`/../dist
CMD="release-cli create --name $CI_COMMIT_TAG --description release-notes.md --tag-name $CI_COMMIT_TAG"
for file in `cat release-files.txt`
do
CMD="$CMD --assets-link {\"name\":\"$file\",\"url\":\"${PACKAGE_REGISTRY_URL}/$file\"}"
done
$CMD

22
debian/changelog vendored
View file

@ -1,3 +1,25 @@
ldapsaisie (4.2.0-1) stable; urgency=medium
* PHP 8.2 support
* LSconfig: add escape_key, explode_keys and implode_keys helper methods
* Improve LSldapObject::getDisplayValue() method to match with getValue() method's parameters
* Fix LSattribute::getDisplayValue() when called on updated attribute
* LSattr_ldap::date: replace unique format parameter by a list
* Fix some french translated messages
* Auth:
* LSauth: add filter_function parameter
* LSauthMethod::CAS: fix support of phpCAS >= 1.6.0 and patched Debian Buster 1.3.6-1+deb10u1 version
* Addons
* accesslog:
* Improve displaying changes attributes values
* Fix infinity loop problem handling entry renaming event with the same DN
* ftp: Remove PEAR Net_FTP dependency
* posix: Add deleteHomeDirectoryByFTP function
* supann: Add supannCMSIdEtiquette attribute support
* doc: switch format to Markdown & Mkdocs
-- Benjamin Renard <brenard@easter-eggs.com> Thu, 26 Oct 2023 11:55:52 +0200
ldapsaisie (4.1.0-1) unstable; urgency=medium
* PHP8 compatibility