Newer
Older
variables:
POSTGRES_DB: "MaarchParapheur"
POSTGRES_USER: maarch
POSTGRES_PASSWORD: ""
stages:
before_script:
- apt-get update -yqq > /dev/null
- apt-get install cron -yqq > /dev/null
- bash ci/docker_install_php.sh > /dev/null
- bash ci/docker_install_database.sh > /dev/null
- mkdir -p /opt/maarchparapheur/docservers/{documents,attachments,signatures,esigned_documents,original_documents}
- ln -s $CI_PROJECT_DIR /var/www/html/MaarchParapheur
- cd /var/www/html/MaarchParapheur
Jean-Laurent DUZANT
committed
- >
sed 's!"server": .*,!"server": "postgres",!; s!"name": .*,!"name": "MaarchParapheur",!; s!"user": .*,!"user": "maarch",!; s!"password": .*,!"password": "maarch",!;s!"enable": .*,!"enable": true,!' config/config.default.json > config/config.json
- sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- mv composer.phar /usr/local/bin/composer
Jean-Laurent DUZANT
committed
job_php-8.1:
stage: test
services:
- name: postgres:10.1
command: [ "-c", "datestyle=iso,dmy" ]
script:
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Jean-Laurent DUZANT
committed
Jean-Laurent DUZANT
committed
artifacts:
paths:
- test/unitTests/build/
expire_in: 2h
# coverage: '^\s*Lines:\s*\d+.\d+\%'
Jean-Laurent DUZANT
committed
job_php-8.0:
image: php:8.0-apache
stage: test
services:
- name: postgres:10.1
command: [ "-c", "datestyle=iso,dmy" ]
script:
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never
Jean-Laurent DUZANT
committed
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Jean-Laurent DUZANT
committed
artifacts:
paths:
- test/unitTests/build/
expire_in: 2h
# coverage: '^\s*Lines:\s*\d+.\d+\%'
Jean-Laurent DUZANT
committed
job_php-7.4:
image: php:7.4-apache
stage: test
services:
- name: postgres:10.1
command: [ "-c", "datestyle=iso,dmy" ]
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never -c phpunit.xml
Jean-Laurent DUZANT
committed
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
artifacts:
paths:
- test/unitTests/build/
expire_in: 2h
# coverage: '^\s*Lines:\s*\d+.\d+\%'
stage: sync
rules:
- if: '$CI_COMMIT_BRANCH =~ /(feat|fix)\/[0-9]*/ && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000"'
- apt-get update -yqq > /dev/null
- apt install -y curl
- apt install -y jq
- chmod +x ./ci/create_mr.sh
- ./ci/create_mr.sh
stage: sync
rules:
- if: '$CI_COMMIT_MESSAGE =~ /^Merge branch/ && $CI_PIPELINE_SOURCE != "schedule" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "2301_releases")'
- chmod +x ./ci/end_mr.sh
- ./ci/end_mr.sh
image: debian:10-slim
stage: after_deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TAG_MODE == "minor"'
before_script:
- apt install -y curl
- apt install -y jq
- apt install -y git
script:
- chmod +x ./ci/check_releases.sh
- ./ci/check_releases.sh
create_minor_tag:
image: php:8.1.14-cli
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TAG_MODE == "minor"'
before_script:
- apt-get update -yqq > /dev/null
- apt install -y curl
- apt install -y jq
- chmod +x ./ci/generate_app_dependencies.sh
- ./ci/generate_app_dependencies.sh
- chmod +x ./ci/new_minor_tag.sh
- ./ci/new_minor_tag.sh
create_major_tag:
image: php:8.1.14-cli
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TAG_MODE == "major"'
before_script:
- apt-get update -yqq > /dev/null
- apt install -y git
- apt install -y curl
- apt install -y jq
- chmod +x ./ci/generate_app_dependencies.sh
- ./ci/generate_app_dependencies.sh
- chmod +x ./ci/new_major_tag.sh
- ./ci/new_major_tag.sh
reset_approvals:
image: debian:10-slim
stage: sync
rules:
- if: '$CI_OPEN_MERGE_REQUESTS != null && $CI_PIPELINE_SOURCE == "push"'
before_script:
- apt-get update -yqq > /dev/null
- apt install -y curl
script:
- MR_ID=`echo $CI_OPEN_MERGE_REQUESTS | grep -oP "!(.)*" | tr -d "!"`
curl --header "PRIVATE-TOKEN: $TOKEN_GITLAB" -X PUT "https://labs.maarch.org/api/v4/projects/$CI_PROJECT_ID/merge_requests/$MR_ID/reset_approvals"
synchronize_tag:
image: labs.maarch.org:5050/maarch/maarchparapheurpro:ci-sync-tag
stage: deploy
rules:
- if: '$CI_COMMIT_TAG'
before_script:
- echo "sync tag"
script:
- cd /app
- php -d memory_limit=512M bin/sync_tag --sourceProjectId $CI_PROJECT_ID --targetProjectId 215 --gitlabToken "$TOKEN_GITLAB" --pluginsToken "$TOKEN_SETASIGN" --tagName "$CI_COMMIT_TAG"