Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 2.52 KiB
image: python:3.11-slim
stages:
- build
- test
- review
- deploy
build:
stage: build
variables:
GIT_DEPTH: 0
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apt-get update && apt-get install -qy git-core
- pip install pipenv
- pipenv install
script:
- pipenv run mkdocs build
- mv site public
artifacts:
paths:
- public
check_links:
image: node:slim
stage: test
dependencies:
- build
before_script:
- npm install broken-link-checker http-server -g
- http-server -a 127.0.0.1 -s &
# Allow the web server to successfully spawn
- sleep 10
script:
- blc -get http://localhost:8080 -ro --exclude 'https://b2access.eudat.eu/saml-idp/SLO-WEB' --exclude 'https://nubes.helmholtz-berlin.de/f/*' --exclude 'https://webfts.fedcloud-tf.fedcloud.eu/' --exclude 'https://hdf-cloud.fz-juelich.de' --exclude 'https://fts3-public.cern.ch' --exclude 'https://events.hifis.net' --exclude 'https://login.helmholtz.de/oauth2' --exclude 'https://login.helmholtz.de/saml-idp/' --exclude 'https://www.hzdr.de' --exclude 'https://kroki.hzdr.de/' --exclude 'https://geant3plus.archive.geant.net' --exclude 'https://rancher.desy.de' --exclude 'https://sonar.desy.de' --exclude 'https://portswigger.net' --exclude 'https://gitlab.desy.de/thomas.beermann/hifiscp-deployment-triggers' --exclude 'https://hifis-cloud-portal-int.desy.de/'
allow_failure: true
review:
stage: review
variables:
GIT_STRATEGY: none
REVIEW_APPS_PATH: review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG
dependencies:
- build
needs: ["build"]
script:
- mkdir -p /var/www/html/gl-review-apps/$REVIEW_APPS_PATH
- rsync -a --delete ./public/. /var/www/html/gl-review-apps/$REVIEW_APPS_PATH/.
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$APPS_DOMAIN/review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG/
on_stop: stop_review
tags:
- review-apps
allow_failure: true
stop_review:
stage: review
variables:
GIT_STRATEGY: none
REVIEW_APPS_PATH: review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG
script:
- rm -rf public /var/www/html/gl-review-apps/$REVIEW_APPS_PATH
- rmdir --ignore-fail-on-non-empty /var/www/html/gl-review-apps/review-apps/$CI_PROJECT_PATH_SLUG/
dependencies: []
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop