Compare commits

..

5 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
Benjamin Renard
59436c9fe4
CI: add tests step on Bookworm 2023-10-26 11:44:47 +02:00
4 changed files with 153 additions and 13 deletions

View file

@ -2,15 +2,42 @@ stages:
- tests - tests
- build - build
- publish - publish
- release
variables: variables:
DOC_BRANCH: doc DOC_BRANCH: doc
DOC_REMOTE: https://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git DOC_REMOTE: https://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" 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: docker.io/brenard/ldapsaisie:bookworm
entrypoint: [""]
stage: tests
rules:
- changes:
- src/**/*.php
script:
- rm -fr vendor
- composer install
- service slapd start
- >
if [ "$GITLAB_CI" == "true" ]; then
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon --error-format=junit > tests-report-bookworm.xml
else
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon
fi
artifacts:
when: always
paths:
- tests-report-bookworm.xml
reports:
junit: tests-report-bookworm.xml
tests:bullseye: tests:bullseye:
image: image:
name: brenard/ldapsaisie:bullseye name: docker.io/brenard/ldapsaisie:bullseye
entrypoint: [""] entrypoint: [""]
stage: tests stage: tests
rules: rules:
@ -35,7 +62,7 @@ tests:bullseye:
tests:buster: tests:buster:
image: image:
name: brenard/ldapsaisie:buster name: docker.io/brenard/ldapsaisie:buster
entrypoint: [""] entrypoint: [""]
stage: tests stage: tests
rules: rules:
@ -61,7 +88,7 @@ tests:buster:
tests:stretch: tests:stretch:
image: image:
name: brenard/ldapsaisie:stretch name: docker.io/brenard/ldapsaisie:stretch
entrypoint: [""] entrypoint: [""]
stage: tests stage: tests
rules: rules:
@ -76,7 +103,7 @@ tests:stretch:
tests:jessie: tests:jessie:
image: image:
name: brenard/ldapsaisie:jessie name: docker.io/brenard/ldapsaisie:jessie
entrypoint: [""] entrypoint: [""]
stage: tests stage: tests
rules: rules:
@ -89,8 +116,24 @@ tests:jessie:
- rm -f .phplint-cache - rm -f .phplint-cache
- /tmp/vendor/bin/phplint src - /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: build:debian-sid:
image: brenard/debian-python-deb:debian11 image: docker.io/brenard/debian-python-deb:debian11
stage: build stage: build
cache: cache:
paths: paths:
@ -106,7 +149,7 @@ build:debian-sid:
build:snapshot: build:snapshot:
stage: build stage: build
image: alpine image: docker.io/alpine
only: only:
- master - master
script: script:
@ -117,7 +160,7 @@ build:snapshot:
build:doc:html: build:doc:html:
stage: build stage: build
image: python:alpine image: docker.io/python:alpine
cache: cache:
paths: paths:
- .cache/pip - .cache/pip
@ -148,7 +191,7 @@ build:doc:html:
build:doc:pdf: build:doc:pdf:
stage: build stage: build
image: image:
name: pink33n/html-to-pdf name: docker.io/pink33n/html-to-pdf
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
only: only:
- master - master
@ -164,7 +207,7 @@ build:doc:pdf:
build:doc:epub: build:doc:epub:
stage: build stage: build
image: image:
name: pandoc/core name: docker.io/pandoc/core
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
only: only:
- master - master
@ -182,7 +225,7 @@ build:doc:epub:
build:doc:append_additional_versions: build:doc:append_additional_versions:
stage: build stage: build
image: python:alpine image: docker.io/python:alpine
only: only:
- master - master
needs: needs:
@ -207,7 +250,7 @@ build:doc:append_additional_versions:
publish:doc: publish:doc:
stage: publish stage: publish
image: alpine:latest image: docker.io/alpine:latest
only: only:
- master - master
needs: needs:
@ -227,7 +270,7 @@ publish:doc:
publish:snapshot: publish:snapshot:
stage: publish stage: publish
image: alpine:latest image: docker.io/alpine:latest
only: only:
- master - master
needs: needs:
@ -241,9 +284,44 @@ publish:snapshot:
script: script:
- rsync -atv ldapsaisie-snapshot.tar.gz $SSH_USER@$SSH_HOST:download/ldapsaisie-snapshot.tar.gz - 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: publish:debian-sid:
stage: publish stage: publish
image: debian:stable-slim image: docker.io/debian:stable-slim
only: only:
- master - master
needs: needs:
@ -259,3 +337,15 @@ publish:debian-sid:
script: script:
- echo "Publish Sid debian packages on APT repository..." - echo "Publish Sid debian packages on APT repository..."
- dupload --to debian-sid dist/ldapsaisie*changes - 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 ldapsaisie (4.1.0-1) unstable; urgency=medium
* PHP8 compatibility * PHP8 compatibility