From ae8358b5c387d265b82014ce358ae6ff52f2f771 Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Tue, 24 Aug 2021 10:51:13 +0200 Subject: [PATCH] change configuration for bulding pages/MR --- .gitlab-ci.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0014ea4a..df9850c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,22 +84,26 @@ build:pages: - .tmp rules: - if: $CI_COMMIT_REF_NAME - - if: $CI_MERGE_REQUEST_ID before_script: - apt-get -qq update - apt-get install -y -qq git-lfs - gem install bundler:$BUNDLER_VERSION && bundle install script: # Generate the configuration for forks (will use Gitlab Pages on personal namespaces) - - 'echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> .ci/_config_gitlab_pages.yml' - - 'echo "baseurl: /$CI_PROJECT_NAME" >> .ci/_config_gitlab_pages.yml' - - # If there is no config for the current branch, use the one for Gitlab Pages - - 'if [ ! -f ".ci/_config_$CI_COMMIT_REF_NAME.yml" ]; then mv .ci/_config_gitlab_pages.yml .ci/_config_$CI_COMMIT_REF_NAME.yml; fi' - + - | + if [ $CI_MERGE_REQUEST_ID ]; then + export CI_COMMIT_REF_NAME="develop"; + else + echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> .ci/_config_gitlab_pages.yml; + echo "baseurl: /$CI_PROJECT_NAME" >> .ci/_config_gitlab_pages.yml; + # If there is no config for the current branch, use the one for Gitlab Pages + if [ ! -f ".ci/_config_$CI_COMMIT_REF_NAME.yml" ]; then + mv .ci/_config_gitlab_pages.yml .ci/_config_$CI_COMMIT_REF_NAME.yml; + fi + fi # Display, which configuration is used - - 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"' - + - | + echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml" # Run Jekyll with custom configuration - bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml" -- GitLab