2022-12-31 02:01:17 +01:00
|
|
|
stages:
|
|
|
|
- tests
|
2023-09-28 12:18:25 +02:00
|
|
|
- build
|
2023-09-28 16:44:54 +02:00
|
|
|
- publish
|
2023-10-26 14:20:40 +02:00
|
|
|
- release
|
2022-12-31 02:01:17 +01:00
|
|
|
|
2023-10-08 10:22:25 +02:00
|
|
|
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"
|
2023-10-26 14:20:40 +02:00
|
|
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}"
|
2023-10-08 10:22:25 +02:00
|
|
|
|
2023-10-26 11:44:47 +02:00
|
|
|
tests:bookworm:
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/brenard/ldapsaisie:bookworm
|
2023-10-26 11:44:47 +02:00
|
|
|
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
|
|
|
|
|
2023-01-03 15:37:19 +01:00
|
|
|
tests:bullseye:
|
2022-12-31 21:15:19 +01:00
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/brenard/ldapsaisie:bullseye
|
2023-01-02 01:45:20 +01:00
|
|
|
entrypoint: [""]
|
2022-12-31 02:01:17 +01:00
|
|
|
stage: tests
|
|
|
|
rules:
|
|
|
|
- changes:
|
2023-05-24 18:30:02 +02:00
|
|
|
- src/**/*.php
|
2022-12-31 02:01:17 +01:00
|
|
|
script:
|
2023-01-11 19:09:23 +01:00
|
|
|
- rm -fr vendor
|
2022-12-31 02:01:17 +01:00
|
|
|
- composer install
|
2022-12-31 21:15:19 +01:00
|
|
|
- service slapd start
|
2023-01-11 19:09:23 +01:00
|
|
|
- >
|
|
|
|
if [ "$GITLAB_CI" == "true" ]; then
|
|
|
|
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon --error-format=junit > tests-report-bullseye.xml
|
|
|
|
else
|
|
|
|
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon
|
|
|
|
fi
|
2022-12-31 02:01:17 +01:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
2023-01-03 15:37:19 +01:00
|
|
|
- tests-report-bullseye.xml
|
2022-12-31 02:01:17 +01:00
|
|
|
reports:
|
2023-01-03 15:37:19 +01:00
|
|
|
junit: tests-report-bullseye.xml
|
|
|
|
|
|
|
|
tests:buster:
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/brenard/ldapsaisie:buster
|
2023-01-03 15:37:19 +01:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: tests
|
|
|
|
rules:
|
|
|
|
- changes:
|
2023-05-24 18:30:02 +02:00
|
|
|
- src/**/*.php
|
2023-01-03 15:37:19 +01:00
|
|
|
script:
|
2023-01-11 19:09:23 +01:00
|
|
|
- rm -fr vendor
|
2023-01-03 15:37:19 +01:00
|
|
|
- composer install
|
|
|
|
- service slapd start
|
|
|
|
- ./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon --error-format=junit > tests-report-buster.xml
|
2023-01-11 19:09:23 +01:00
|
|
|
- >
|
|
|
|
if [ "$GITLAB_CI" == "true" ]; then
|
|
|
|
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon --error-format=junit > tests-report-buster.xml
|
|
|
|
else
|
|
|
|
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon
|
|
|
|
fi
|
2023-01-03 15:37:19 +01:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- tests-report-buster.xml
|
|
|
|
reports:
|
|
|
|
junit: tests-report-buster.xml
|
|
|
|
|
|
|
|
tests:stretch:
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/brenard/ldapsaisie:stretch
|
2023-01-03 15:37:19 +01:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: tests
|
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- src/*
|
|
|
|
script:
|
|
|
|
- cd /tmp/
|
|
|
|
- composer require overtrue/phplint --dev
|
|
|
|
- cd -
|
|
|
|
- rm -f .phplint-cache
|
|
|
|
- /tmp/vendor/bin/phplint src
|
|
|
|
|
|
|
|
tests:jessie:
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/brenard/ldapsaisie:jessie
|
2023-01-03 15:37:19 +01:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: tests
|
|
|
|
rules:
|
|
|
|
- changes:
|
2023-05-24 18:30:02 +02:00
|
|
|
- src/**/*.php
|
2023-01-03 15:37:19 +01:00
|
|
|
script:
|
|
|
|
- cd /tmp/
|
|
|
|
- composer require overtrue/phplint --dev
|
|
|
|
- cd -
|
|
|
|
- rm -f .phplint-cache
|
|
|
|
- /tmp/vendor/bin/phplint src
|
2023-05-24 18:30:41 +02:00
|
|
|
|
2023-10-26 12:35:56 +02:00
|
|
|
build:debian-stable:
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/brenard/debian-python-deb:debian11
|
2023-10-26 12:35:56 +02:00
|
|
|
stage: build
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/pip
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./build-deb.sh --install-build-deps
|
|
|
|
- rm -fr dist/ldapsaisie-*
|
2023-10-26 14:20:40 +02:00
|
|
|
- dpkg-parsechangelog --format dpkg|awk '/ ldapsaisie /,0'|tail -n +3 > dist/release-notes.md
|
2023-10-26 12:35:56 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*
|
|
|
|
|
2023-09-28 16:44:54 +02:00
|
|
|
build:debian-sid:
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/brenard/debian-python-deb:debian11
|
2023-09-28 16:44:54 +02:00
|
|
|
stage: build
|
2023-10-08 10:22:25 +02:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/pip
|
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 16:44:54 +02:00
|
|
|
script:
|
|
|
|
- ./build-deb.sh --install-build-deps --sid
|
2023-10-08 23:53:37 +02:00
|
|
|
- rm -fr dist/ldapsaisie-*
|
2023-09-28 16:44:54 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*
|
|
|
|
|
2023-09-28 14:27:35 +02:00
|
|
|
build:snapshot:
|
|
|
|
stage: build
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/alpine
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 14:27:35 +02:00
|
|
|
script:
|
|
|
|
- tar -czf ldapsaisie-snapshot.tar.gz --exclude=ldapsaisie-snapshot.tar.gz ./
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ldapsaisie-snapshot.tar.gz
|
|
|
|
|
2023-10-08 10:22:25 +02:00
|
|
|
build:doc:html:
|
2023-09-28 12:18:25 +02:00
|
|
|
stage: build
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/python:alpine
|
2023-10-08 10:22:25 +02:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/pip
|
|
|
|
- doc/venv
|
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 12:18:25 +02:00
|
|
|
before_script:
|
2023-10-08 10:22:25 +02:00
|
|
|
- apk add make git
|
|
|
|
- git config user.name $GITLAB_USER_NAME
|
|
|
|
- git config user.email $GITLAB_USER_EMAIL
|
|
|
|
- VERSION=`git describe --tags`
|
2023-09-28 12:18:25 +02:00
|
|
|
- cd doc
|
2023-10-08 10:22:25 +02:00
|
|
|
- git fetch origin $DOC_BRANCH
|
|
|
|
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
|
|
|
- git checkout -b $DOC_BRANCH origin/$DOC_BRANCH
|
|
|
|
- git checkout $CI_COMMIT_SHA
|
|
|
|
- make clean && make venv
|
|
|
|
script:
|
|
|
|
- make LdapSaisie.html
|
|
|
|
- test -n "$CI_COMMIT_TAG" && DOC_TAG=stable || DOC_TAG=dev
|
|
|
|
- source venv/bin/activate # We must have to activate the venv to use mike (direct call not supported)
|
|
|
|
- mike deploy --branch $DOC_BRANCH --remote $DOC_REMOTE --push --update-aliases $VERSION $DOC_TAG
|
|
|
|
- mike set-default --branch $DOC_BRANCH --remote $DOC_REMOTE --push $DOC_TAG
|
2023-09-28 12:18:25 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- doc/LdapSaisie.html
|
|
|
|
|
|
|
|
build:doc:pdf:
|
|
|
|
stage: build
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/pink33n/html-to-pdf
|
2023-09-28 12:18:25 +02:00
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 12:18:25 +02:00
|
|
|
needs:
|
2023-10-08 10:22:25 +02:00
|
|
|
- build:doc:html
|
2023-09-28 12:18:25 +02:00
|
|
|
script:
|
2023-10-08 10:22:25 +02:00
|
|
|
- rm -f doc/LdapSaisie.pdf
|
|
|
|
- /usr/local/bin/entrypoint --url file://$(pwd)/doc/LdapSaisie.html --pdf doc/LdapSaisie.pdf || test -f doc/LdapSaisie.pdf
|
2023-09-28 12:18:25 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- doc/LdapSaisie.pdf
|
|
|
|
|
|
|
|
build:doc:epub:
|
|
|
|
stage: build
|
|
|
|
image:
|
2023-10-26 14:23:00 +02:00
|
|
|
name: docker.io/pandoc/core
|
2023-09-28 12:18:25 +02:00
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 12:18:25 +02:00
|
|
|
needs:
|
2023-10-08 10:22:25 +02:00
|
|
|
- build:doc:html
|
2023-09-28 12:18:25 +02:00
|
|
|
before_script:
|
|
|
|
- apk add make
|
|
|
|
script:
|
|
|
|
- cd doc
|
|
|
|
- test ! -d venv && mkdir venv && touch public_html LdapSaisie.html
|
|
|
|
- make LdapSaisie.epub
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- doc/LdapSaisie.epub
|
|
|
|
|
2023-10-08 10:22:25 +02:00
|
|
|
build:doc:append_additional_versions:
|
|
|
|
stage: build
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/python:alpine
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
needs:
|
|
|
|
- build:doc:html
|
|
|
|
- build:doc:pdf
|
|
|
|
- build:doc:epub
|
|
|
|
before_script:
|
|
|
|
- apk add git
|
|
|
|
- git config user.name $GITLAB_USER_NAME
|
|
|
|
- git config user.email $GITLAB_USER_EMAIL
|
|
|
|
- VERSION=`git describe --tags`
|
|
|
|
- cd doc
|
|
|
|
- git fetch origin $DOC_BRANCH
|
|
|
|
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
|
|
|
- git checkout -b $DOC_BRANCH origin/$DOC_BRANCH
|
|
|
|
- git pull origin $DOC_BRANCH
|
|
|
|
script:
|
|
|
|
- cp LdapSaisie.html LdapSaisie.pdf LdapSaisie.epub dist/$VERSION/
|
|
|
|
- git add dist/$VERSION/
|
|
|
|
- git commit --amend --no-edit
|
|
|
|
- git push --force $DOC_REMOTE $DOC_BRANCH
|
|
|
|
|
|
|
|
publish:doc:
|
|
|
|
stage: publish
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/alpine:latest
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
needs:
|
|
|
|
- build:doc:append_additional_versions
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add git openssh-client rsync
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add -
|
|
|
|
- mkdir ~/.ssh
|
|
|
|
- echo "$SSH_HOST_KEY" | base64 -d > ~/.ssh/known_hosts
|
|
|
|
- git fetch origin $DOC_BRANCH
|
|
|
|
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
|
|
|
- git checkout -b $DOC_BRANCH origin/$DOC_BRANCH
|
|
|
|
- git pull origin $DOC_BRANCH
|
|
|
|
script:
|
|
|
|
- rsync -atv --exclude '.git*' --delete --progress ./doc/dist/ $SSH_USER@$SSH_HOST:doc/
|
|
|
|
|
|
|
|
publish:snapshot:
|
2023-09-28 16:44:54 +02:00
|
|
|
stage: publish
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/alpine:latest
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 16:44:54 +02:00
|
|
|
needs:
|
2023-10-08 10:22:25 +02:00
|
|
|
- build:snapshot
|
2023-09-28 12:18:25 +02:00
|
|
|
before_script:
|
|
|
|
- apk update && apk add openssh-client rsync
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add -
|
|
|
|
- mkdir ~/.ssh
|
|
|
|
- echo "$SSH_HOST_KEY" | base64 -d > ~/.ssh/known_hosts
|
2023-05-24 18:30:41 +02:00
|
|
|
script:
|
2023-09-28 14:27:35 +02:00
|
|
|
- rsync -atv ldapsaisie-snapshot.tar.gz $SSH_USER@$SSH_HOST:download/ldapsaisie-snapshot.tar.gz
|
2023-09-28 16:44:54 +02:00
|
|
|
|
2023-10-26 12:35:56 +02:00
|
|
|
publish:debian-stable:
|
|
|
|
stage: publish
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/debian:stable-slim
|
2023-10-26 12:35:56 +02:00
|
|
|
needs:
|
|
|
|
- build:debian-stable
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
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
|
|
|
|
|
2023-10-26 14:20:40 +02:00
|
|
|
publish:gitlab:
|
|
|
|
stage: publish
|
|
|
|
image:
|
|
|
|
name: docker.io/alpine/httpie
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
needs:
|
|
|
|
- build:debian-stable
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./.gitlab/publish.sh
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/release-notes.md
|
|
|
|
- dist/release-files.txt
|
|
|
|
|
2023-09-28 16:44:54 +02:00
|
|
|
publish:debian-sid:
|
|
|
|
stage: publish
|
2023-10-26 14:23:00 +02:00
|
|
|
image: docker.io/debian:stable-slim
|
2023-10-08 10:22:25 +02:00
|
|
|
only:
|
|
|
|
- master
|
2023-09-28 16:44:54 +02:00
|
|
|
needs:
|
2023-10-08 10:22:25 +02:00
|
|
|
- build:debian-sid
|
2023-09-28 16:44:54 +02:00
|
|
|
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 Sid debian packages on APT repository..."
|
|
|
|
- dupload --to debian-sid dist/ldapsaisie*changes
|
2023-10-26 14:20:40 +02:00
|
|
|
|
|
|
|
release:
|
|
|
|
stage: release
|
|
|
|
image:
|
|
|
|
name: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
needs:
|
|
|
|
- publish:gitlab
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./.gitlab/release.sh
|