mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
153 lines
3.6 KiB
YAML
153 lines
3.6 KiB
YAML
stages:
|
|
- tests
|
|
- build
|
|
- deploy
|
|
|
|
tests:bullseye:
|
|
image:
|
|
name: brenard/ldapsaisie:bullseye
|
|
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-bullseye.xml
|
|
else
|
|
./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon
|
|
fi
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- tests-report-bullseye.xml
|
|
reports:
|
|
junit: tests-report-bullseye.xml
|
|
|
|
tests:buster:
|
|
image:
|
|
name: brenard/ldapsaisie:buster
|
|
entrypoint: [""]
|
|
|
|
stage: tests
|
|
rules:
|
|
- changes:
|
|
- src/**/*.php
|
|
script:
|
|
- rm -fr vendor
|
|
- composer install
|
|
- service slapd start
|
|
- ./vendor/bin/phpstan analyse --no-interaction --configuration=.phpstan/config.neon --error-format=junit > tests-report-buster.xml
|
|
- >
|
|
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
|
|
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:
|
|
- src/**/*.php
|
|
script:
|
|
- cd /tmp/
|
|
- composer require overtrue/phplint --dev
|
|
- cd -
|
|
- rm -f .phplint-cache
|
|
- /tmp/vendor/bin/phplint src
|
|
|
|
build:snapshot:
|
|
stage: build
|
|
image: alpine
|
|
script:
|
|
- tar -czf ldapsaisie-snapshot.tar.gz --exclude=ldapsaisie-snapshot.tar.gz ./
|
|
artifacts:
|
|
paths:
|
|
- ldapsaisie-snapshot.tar.gz
|
|
|
|
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
|
|
|
|
deploy:
|
|
stage: deploy
|
|
image: alpine:latest
|
|
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
|
|
script:
|
|
- 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
|