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
|
2022-12-31 02:01:17 +01:00
|
|
|
|
2023-01-03 15:37:19 +01:00
|
|
|
tests:bullseye:
|
2022-12-31 21:15:19 +01:00
|
|
|
image:
|
2023-01-03 15:37:19 +01:00
|
|
|
name: brenard/ldapsaisie:bullseye
|
2023-01-02 01:45:20 +01:00
|
|
|
entrypoint: [""]
|
2023-01-02 01:38:47 +01:00
|
|
|
|
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:
|
|
|
|
name: brenard/ldapsaisie:buster
|
|
|
|
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:
|
|
|
|
name: brenard/ldapsaisie:stretch
|
|
|
|
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:
|
|
|
|
name: brenard/ldapsaisie:jessie
|
|
|
|
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-09-28 16:44:54 +02:00
|
|
|
build:debian-sid:
|
|
|
|
image: brenard/debian-python-deb:debian11
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- ./build-deb.sh --install-build-deps --sid
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*
|
|
|
|
|
2023-09-28 14:27:35 +02:00
|
|
|
build:snapshot:
|
|
|
|
stage: build
|
|
|
|
image: alpine
|
|
|
|
script:
|
|
|
|
- tar -czf ldapsaisie-snapshot.tar.gz --exclude=ldapsaisie-snapshot.tar.gz ./
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ldapsaisie-snapshot.tar.gz
|
|
|
|
|
2023-09-28 12:18:25 +02:00
|
|
|
build:doc:
|
|
|
|
stage: build
|
|
|
|
image: python:alpine
|
|
|
|
before_script:
|
|
|
|
- apk add make
|
|
|
|
script:
|
|
|
|
- cd doc
|
|
|
|
- make public_html LdapSaisie.html
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- doc/public_html/
|
|
|
|
- doc/LdapSaisie.html
|
|
|
|
|
|
|
|
build:doc:pdf:
|
|
|
|
stage: build
|
|
|
|
image:
|
|
|
|
name: pink33n/html-to-pdf
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
needs:
|
|
|
|
- build:doc
|
|
|
|
script:
|
|
|
|
- /usr/local/bin/entrypoint --url file://$(pwd)/doc/LdapSaisie.html --pdf doc/LdapSaisie.pdf
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- doc/LdapSaisie.pdf
|
|
|
|
|
|
|
|
build:doc:epub:
|
|
|
|
stage: build
|
|
|
|
image:
|
|
|
|
name: pandoc/core
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
needs:
|
|
|
|
- build:doc
|
|
|
|
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-09-28 16:44:54 +02:00
|
|
|
publish:
|
|
|
|
stage: publish
|
2023-09-28 12:18:25 +02:00
|
|
|
image: alpine:latest
|
2023-09-28 16:44:54 +02:00
|
|
|
needs:
|
|
|
|
- 'build:doc'
|
|
|
|
- 'build:doc:pdf'
|
|
|
|
- 'build:doc:epub'
|
|
|
|
- '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 --exclude '.git*' --delete --progress ./doc/public_html/ $SSH_USER@$SSH_HOST:doc/
|
|
|
|
- rsync -atv ./doc/LdapSaisie.html ./doc/LdapSaisie.pdf ./doc/LdapSaisie.epub $SSH_USER@$SSH_HOST:doc/
|
|
|
|
- rsync -atv ldapsaisie-snapshot.tar.gz $SSH_USER@$SSH_HOST:download/ldapsaisie-snapshot.tar.gz
|
2023-09-28 16:44:54 +02:00
|
|
|
|
|
|
|
publish:debian-sid:
|
|
|
|
stage: publish
|
|
|
|
image: debian:stable-slim
|
|
|
|
needs:
|
|
|
|
- 'build:debian-sid'
|
|
|
|
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
|