stages: - build - review variables: GIT_STRATEGY: clone Build for review: stage: build before_script: - bundle config set path '/home/gitlab-runner/.gem' - bundle install && bundle update script: - 'echo "project_id: $CI_PROJECT_ID" > _config_review.yml' - 'echo "project_namespace: $CI_PROJECT_PATH" >> _config_review.yml' - 'echo "mr_id: $CI_MERGE_REQUEST_ID" >> _config_review.yml' - 'echo "gitlab_host: https://git-r3lab.uni.lu" >> _config_review.yml' - pwd - bundle exec jekyll build -d public --config "_config.yml,_config_review.yml" artifacts: expire_in: 1 month paths: - public variables: JEKYLL_ENV: review rules: - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' tags: - review-app Publish review: stage: review script: - rsync -av --delete public /srv/nginx/pages/$CI_PROJECT_ID/$CI_MERGE_REQUEST_ID environment: name: review/$CI_BUILD_REF_NAME/$CI_PROJECT_PATH url: http://$CI_MERGE_REQUEST_ID-$CI_PROJECT_ID.review.lcsb.uni.lu on_stop: "Un-publish review" auto_stop_in: 1 week rules: - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' tags: - review-app Un-publish review: stage: review script: - rm -rf /srv/nginx/pages/$CI_PROJECT_ID/$CI_MERGE_REQUEST_ID variables: GIT_STRATEGY: none when: manual environment: name: review/$CI_BUILD_REF_NAME/$CI_PROJECT_PATH action: stop tags: - review-app