From c239d3e83182f3df4f6f87bce80f96d915b83529 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:09:49 +0100 Subject: [PATCH 01/21] Add key "changes" to execute test jobs only if html or yaml changed * With key "changes" one can specify whether jobs need to be executed. * Here we only want to execute test jobs if html or yaml files had been changed. * This way we would like to speed up the ci pipeline in certain cases. --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d4e3e2..cb4c2db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,13 @@ stages: only: - master +.only_if_html_or_yaml_changed: &only_if_html_or_yaml_changed + only: + changes: + - public/**/*.html + - _data/*.yml + - _config.yml + .common_production: &production_before_script before_script: - gem install bundler --no-document @@ -89,6 +96,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true + <<: *only_if_html_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From 7bc7ab71bbc18636226f98c627ce5c6a2f21a601 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:34:50 +0100 Subject: [PATCH 02/21] Test invoking jobs in ci pipeline only on certain conditions * Check whether html, css, yaml, md is changed in commits. --- .gitlab-ci.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb4c2db..ffccb95 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,10 +28,27 @@ stages: only: - master -.only_if_html_or_yaml_changed: &only_if_html_or_yaml_changed +.only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed only: changes: - - public/**/*.html + - _includes/**/*.html + - _layouts/**/*.html + - blog/index.html + - services/index.md + - CONTRIBUTING.md + - events.md + - faq.md + - imprint.md + - index.md + - LICENSE.md + - privacy.md + - README.md + - team.md + - _events/*.md + - _members/*.md + - _posts/**/*.md + - _sass/**/*.scss + - assets/**/* - _data/*.yml - _config.yml @@ -96,7 +113,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_or_yaml_changed + <<: *only_if_html_or_md_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From e773f9f111af72d473ec2f128f59f4a1626d3ae9 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:39:02 +0100 Subject: [PATCH 03/21] Fixed typo in gitlab ci pipeline yaml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffccb95..8c1d8f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -113,7 +113,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_or_md_or_yaml_changed + <<: *only_if_html_css_md_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From b857959a6aa63e84f88bae26fc5fb40c06b7dac8 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:47:02 +0100 Subject: [PATCH 04/21] Reduce changes check for test jobs in gitlab ci pipeline * Check if changes are made in html, scss, md, yaml files. * Check if chnages are made in assets folder. --- .gitlab-ci.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c1d8f0..4b64ad8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,26 +31,8 @@ stages: .only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed only: changes: - - _includes/**/*.html - - _layouts/**/*.html - - blog/index.html - - services/index.md - - CONTRIBUTING.md - - events.md - - faq.md - - imprint.md - - index.md - - LICENSE.md - - privacy.md - - README.md - - team.md - - _events/*.md - - _members/*.md - - _posts/**/*.md - - _sass/**/*.scss - - assets/**/* - - _data/*.yml - - _config.yml + - ./**/*.{html,md,scss,yml} + - ./assets/**/* .common_production: &production_before_script before_script: -- GitLab From b0a229c49eab624b45c7a35fe775d88d07149a3f Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:59:47 +0100 Subject: [PATCH 05/21] Add exceptions to the changes rule which do not need to be tested * Disregard checking changes of some files for which the project need not to be tested. --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b64ad8..8143ee2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,11 +28,17 @@ stages: only: - master -.only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed +# https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges +.only_if_html_scss_md_or_yaml_changed: &only_if_html_scss_md_or_yaml_changed only: changes: - ./**/*.{html,md,scss,yml} - ./assets/**/* + except: + changes: + - ./.git* + - ./Gemfile* + - ./.gitlab/**/* .common_production: &production_before_script before_script: @@ -93,9 +99,10 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production + <<: *only_if_html_scss_md_or_yaml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_css_md_or_yaml_changed + # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From fb1b2adb6aba2fb34652982a3651e640486a90e7 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 09:27:58 +0100 Subject: [PATCH 06/21] Change trigger which executes test jobs in ci pipeline * Only trigger test jobs if html, md odr yml files had been changed. * Use performance tag if merge request into branch master. --- .gitlab-ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8143ee2..97992b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,17 +28,24 @@ stages: only: - master +# https://docs.gitlab.com/ee/ci/yaml/#rules +.additional_tags_only_if_master: &additional_tags_only_if_master + rules: + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" + tags: + - performance + # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges -.only_if_html_scss_md_or_yaml_changed: &only_if_html_scss_md_or_yaml_changed +.only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: changes: - - ./**/*.{html,md,scss,yml} - - ./assets/**/* + - ./**/*.{html,md,yml} except: changes: - ./.git* - ./Gemfile* - ./.gitlab/**/* + - ./assets/**/* .common_production: &production_before_script before_script: @@ -68,6 +75,7 @@ stages: -d public$SUBPATH \ --baseurl $SUBPATH" - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" + <<: *additional_tags_only_if_master # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -99,7 +107,8 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production - <<: *only_if_html_scss_md_or_yaml_changed + <<: *additional_tags_only_if_master + <<: *only_if_html_md_or_yml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -223,6 +232,8 @@ pages: extends: - .only_extension - .artifacts_extension + tags: + - performance production: stage: deploy -- GitLab From 203ec2b5b3a3975ffa2636b235e1dbbe5a3bd481 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 11:21:13 +0100 Subject: [PATCH 07/21] Remove yaml include for rules keyword * if-condition rule does not work with tags keyword. --- .gitlab-ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97992b4..d0ce61c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,13 +28,6 @@ stages: only: - master -# https://docs.gitlab.com/ee/ci/yaml/#rules -.additional_tags_only_if_master: &additional_tags_only_if_master - rules: - - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" - tags: - - performance - # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges .only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: @@ -75,7 +68,6 @@ stages: -d public$SUBPATH \ --baseurl $SUBPATH" - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" - <<: *additional_tags_only_if_master # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -107,7 +99,6 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production - <<: *additional_tags_only_if_master <<: *only_if_html_md_or_yml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true -- GitLab From 963fe342093b062e2095ad66e16c48e1a5de2671 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:09:49 +0100 Subject: [PATCH 08/21] Add key "changes" to execute test jobs only if html or yaml changed * With key "changes" one can specify whether jobs need to be executed. * Here we only want to execute test jobs if html or yaml files had been changed. * This way we would like to speed up the ci pipeline in certain cases. --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d4e3e2..cb4c2db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,13 @@ stages: only: - master +.only_if_html_or_yaml_changed: &only_if_html_or_yaml_changed + only: + changes: + - public/**/*.html + - _data/*.yml + - _config.yml + .common_production: &production_before_script before_script: - gem install bundler --no-document @@ -89,6 +96,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true + <<: *only_if_html_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From 69875788a97bf7d8f6f7850abdef31b775efdc07 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:34:50 +0100 Subject: [PATCH 09/21] Test invoking jobs in ci pipeline only on certain conditions * Check whether html, css, yaml, md is changed in commits. --- .gitlab-ci.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb4c2db..ffccb95 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,10 +28,27 @@ stages: only: - master -.only_if_html_or_yaml_changed: &only_if_html_or_yaml_changed +.only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed only: changes: - - public/**/*.html + - _includes/**/*.html + - _layouts/**/*.html + - blog/index.html + - services/index.md + - CONTRIBUTING.md + - events.md + - faq.md + - imprint.md + - index.md + - LICENSE.md + - privacy.md + - README.md + - team.md + - _events/*.md + - _members/*.md + - _posts/**/*.md + - _sass/**/*.scss + - assets/**/* - _data/*.yml - _config.yml @@ -96,7 +113,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_or_yaml_changed + <<: *only_if_html_or_md_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From e5971974ce9531558cbbad265bdc2d5916340fd4 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:39:02 +0100 Subject: [PATCH 10/21] Fixed typo in gitlab ci pipeline yaml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffccb95..8c1d8f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -113,7 +113,7 @@ stages: <<: *cache_production # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_or_md_or_yaml_changed + <<: *only_if_html_css_md_or_yaml_changed # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From 88d0640200c184e71f3eddc2f80593a80d53c8f5 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:47:02 +0100 Subject: [PATCH 11/21] Reduce changes check for test jobs in gitlab ci pipeline * Check if changes are made in html, scss, md, yaml files. * Check if chnages are made in assets folder. --- .gitlab-ci.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c1d8f0..4b64ad8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,26 +31,8 @@ stages: .only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed only: changes: - - _includes/**/*.html - - _layouts/**/*.html - - blog/index.html - - services/index.md - - CONTRIBUTING.md - - events.md - - faq.md - - imprint.md - - index.md - - LICENSE.md - - privacy.md - - README.md - - team.md - - _events/*.md - - _members/*.md - - _posts/**/*.md - - _sass/**/*.scss - - assets/**/* - - _data/*.yml - - _config.yml + - ./**/*.{html,md,scss,yml} + - ./assets/**/* .common_production: &production_before_script before_script: -- GitLab From bc5a7a7c273323054dbf70423adbafb6eca655de Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Mon, 10 Feb 2020 16:59:47 +0100 Subject: [PATCH 12/21] Add exceptions to the changes rule which do not need to be tested * Disregard checking changes of some files for which the project need not to be tested. --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b64ad8..8143ee2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,11 +28,17 @@ stages: only: - master -.only_if_html_css_md_or_yaml_changed: &only_if_html_css_md_or_yaml_changed +# https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges +.only_if_html_scss_md_or_yaml_changed: &only_if_html_scss_md_or_yaml_changed only: changes: - ./**/*.{html,md,scss,yml} - ./assets/**/* + except: + changes: + - ./.git* + - ./Gemfile* + - ./.gitlab/**/* .common_production: &production_before_script before_script: @@ -93,9 +99,10 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production + <<: *only_if_html_scss_md_or_yaml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - <<: *only_if_html_css_md_or_yaml_changed + # Job runs jekyll build with latest dependencies. build:latest: -- GitLab From 7ad42c23e98b8ef72487f0c596767228b819d86d Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 09:27:58 +0100 Subject: [PATCH 13/21] Change trigger which executes test jobs in ci pipeline * Only trigger test jobs if html, md odr yml files had been changed. * Use performance tag if merge request into branch master. --- .gitlab-ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8143ee2..97992b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,17 +28,24 @@ stages: only: - master +# https://docs.gitlab.com/ee/ci/yaml/#rules +.additional_tags_only_if_master: &additional_tags_only_if_master + rules: + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" + tags: + - performance + # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges -.only_if_html_scss_md_or_yaml_changed: &only_if_html_scss_md_or_yaml_changed +.only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: changes: - - ./**/*.{html,md,scss,yml} - - ./assets/**/* + - ./**/*.{html,md,yml} except: changes: - ./.git* - ./Gemfile* - ./.gitlab/**/* + - ./assets/**/* .common_production: &production_before_script before_script: @@ -68,6 +75,7 @@ stages: -d public$SUBPATH \ --baseurl $SUBPATH" - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" + <<: *additional_tags_only_if_master # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -99,7 +107,8 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production - <<: *only_if_html_scss_md_or_yaml_changed + <<: *additional_tags_only_if_master + <<: *only_if_html_md_or_yml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -223,6 +232,8 @@ pages: extends: - .only_extension - .artifacts_extension + tags: + - performance production: stage: deploy -- GitLab From 3ea3f2666164d5cd37d5bfee7a7814bee864042e Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 11:21:13 +0100 Subject: [PATCH 14/21] Remove yaml include for rules keyword * if-condition rule does not work with tags keyword. --- .gitlab-ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97992b4..d0ce61c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,13 +28,6 @@ stages: only: - master -# https://docs.gitlab.com/ee/ci/yaml/#rules -.additional_tags_only_if_master: &additional_tags_only_if_master - rules: - - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" - tags: - - performance - # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges .only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: @@ -75,7 +68,6 @@ stages: -d public$SUBPATH \ --baseurl $SUBPATH" - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" - <<: *additional_tags_only_if_master # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true @@ -107,7 +99,6 @@ stages: # Use yaml-lint tool to check yaml files. - "yaml-lint _data/ _config.yml" <<: *cache_production - <<: *additional_tags_only_if_master <<: *only_if_html_md_or_yml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true -- GitLab From 2c839b87d5c2356e62cdb26d6baf590deecfbf54 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 17:03:28 +0100 Subject: [PATCH 15/21] Add tag "internal" to all jobs but review-app jobs * It might be sufficient to boost the jobs in the pipeline with tag "internal" instead of "performance" which should be kept for cases where we need additional performance for compute intensive workload. --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0ce61c..95d92ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,6 +70,8 @@ stages: - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true + tags: + - internal .tests: &tests stage: test @@ -102,7 +104,8 @@ stages: <<: *only_if_html_md_or_yml_changed # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true - + tags: + - internal # Job runs jekyll build with latest dependencies. build:latest: @@ -167,8 +170,6 @@ test:htmlproofer:external_links: --assume-extension public/" only: - schedules - tags: - - internal review: stage: review @@ -224,7 +225,7 @@ pages: - .only_extension - .artifacts_extension tags: - - performance + - internal production: stage: deploy -- GitLab From 82c9ae1239e062344d8be9b81bf54f56bd6db7f4 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 18:37:13 +0100 Subject: [PATCH 16/21] [WIP] Try a switch to use HPC resources for a determined period of time * The goal is to set a time until the jobs are executed in a HPC pipeline: 1. Set variable USE_HPC_RESOURCES_UNTIL in format: 2020-02-11T19:15:00+01:00 2. Trigger pipeline via push to remote branch. 3. Until specified time is reached "performance" pipeline is executed. --- .gitlab-ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1d1fdb..a3084c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,10 @@ stages: tags: - internal +.use_performance_servers: &use_performance_servers + tags: + - performance + # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges .only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: @@ -48,6 +52,8 @@ stages: before_script: - gem install bundler --no-document - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" + - export JOB_START_TIMESTAMP=$(date -Iseconds) + - export USE_HPC_RESOURCES=$($JOB_START_TIMESTAMP < $USE_HPC_RESOURCES_UNTIL) <<: *cache_production .common_latest: &latest_before_script @@ -62,6 +68,7 @@ stages: SUBPATH: "/" BUNDLE_PATH: vendor/bundle NOKOGIRI_USE_SYSTEM_LIBRARIES: "1" + USE_HPC_RESOURCES_UNTIL: "2020-02-11T19:15:00+01:00" .builds: &builds stage: build @@ -75,6 +82,27 @@ stages: # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true <<: *use_internal_servers + rules: +# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" || $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES != "1"' + when: always + +.builds_performance: &builds_performance + stage: build + variables: + <<: *common_variables + script: + - "bundle exec jekyll build --future \ + -d public$SUBPATH \ + --baseurl $SUBPATH" + - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" + # https://docs.gitlab.com/ce/ci/yaml/#interruptible + interruptible: true + <<: *use_performance_servers + rules: +# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "1"' + when: always .tests: &tests stage: test @@ -146,6 +174,43 @@ build:production: extends: - .artifacts_extension +# Job runs jekyll build with latest dependencies. +build:latest:prformance: + <<: *builds_performance + <<: *latest_before_script + image: ruby:latest + allow_failure: true + +# Job runs jekyll build latest dependencies, +# puts everything in a sub-directory while specifying baseurl. +build:production:subpath:prformance: + <<: *builds_performance + <<: *production_before_script + image: ruby:latest + variables: + <<: *common_variables + SUBPATH: /$CI_PROJECT_NAME + extends: + - .artifacts_extension + +# Job runs jekyll build with production dependencies, +# puts everything in a sub-directory as required for review apps. +build:production:review-apps:prformance: + <<: *builds_performance + <<: *production_before_script + variables: + <<: *common_variables + SUBPATH: /review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG + extends: + - .artifacts_extension + +# Job runs jekyll build with current production dependencies +build:production:prformance: + <<: *builds_performance + <<: *production_before_script + extends: + - .artifacts_extension + # Job runs htmlproofer basing on production build. test:htmlproofer: <<: *tests -- GitLab From 90ab4f2d057066eabd2816f8e974d6f83a796dd3 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 19:30:08 +0100 Subject: [PATCH 17/21] [WIP] Try temporary switch to boost pipeline * Try USE_HPC_RESOURCES_UNTIL_TIMESTAMP as a upper bound until pipeline is boosted. --- .gitlab-ci.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3084c3..ae26a6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,17 +50,25 @@ stages: .common_production: &production_before_script before_script: - - gem install bundler --no-document - - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" - - export JOB_START_TIMESTAMP=$(date -Iseconds) - - export USE_HPC_RESOURCES=$($JOB_START_TIMESTAMP < $USE_HPC_RESOURCES_UNTIL) + - 'gem install bundler --no-document' + - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' + - 'export JOB_START_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")' + - 'export JOB_START_SECONDS=$(date +%s -d"$JOB_START_TIMESTAMP")' + - 'export USE_HPC_RESOURCES_UNTIL_SECONDS=$(date +%s -d"$USE_HPC_RESOURCES_UNTIL_TIMESTAMP")' + - 'if [[ "$JOB_START_SECONDS" -lt "$USE_HPC_RESOURCES_UNTIL_SECONDS" ]]; then USE_HPC_RESOURCES=1; else USE_HPC_RESOURCES=0; fi' + - 'echo "USE_HPC_RESOURCES: $USE_HPC_RESOURCES until: $USE_HPC_RESOURCES_UNTIL_TIMESTAMP."' <<: *cache_production .common_latest: &latest_before_script before_script: - - "[[ -f \"Gemfile.lock\" ]] && rm Gemfile.lock" - - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" - - bundle update --jobs $(nproc) "${FLAGS[@]}" + - '[[ -f \"Gemfile.lock\" ]] && rm Gemfile.lock' + - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' + - 'bundle update --jobs $(nproc) "${FLAGS[@]}"' + - 'export JOB_START_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")' + - 'export JOB_START_SECONDS=$(date +%s -d"$JOB_START_TIMESTAMP")' + - 'export USE_HPC_RESOURCES_UNTIL_SECONDS=$(date +%s -d"$USE_HPC_RESOURCES_UNTIL_TIMESTAMP")' + - 'if [[ "$JOB_START_SECONDS" -lt "$USE_HPC_RESOURCES_UNTIL_SECONDS" ]]; then USE_HPC_RESOURCES=1; else USE_HPC_RESOURCES=0; fi' + - 'echo "USE_HPC_RESOURCES: $USE_HPC_RESOURCES until: $USE_HPC_RESOURCES_UNTIL_TIMESTAMP."' <<: *cache_latest .common_variables: &common_variables @@ -68,7 +76,7 @@ stages: SUBPATH: "/" BUNDLE_PATH: vendor/bundle NOKOGIRI_USE_SYSTEM_LIBRARIES: "1" - USE_HPC_RESOURCES_UNTIL: "2020-02-11T19:15:00+01:00" + USE_HPC_RESOURCES_UNTIL_TIMESTAMP: "2020-02-11 20:00:00" .builds: &builds stage: build @@ -175,7 +183,7 @@ build:production: - .artifacts_extension # Job runs jekyll build with latest dependencies. -build:latest:prformance: +build:latest:performance: <<: *builds_performance <<: *latest_before_script image: ruby:latest @@ -183,7 +191,7 @@ build:latest:prformance: # Job runs jekyll build latest dependencies, # puts everything in a sub-directory while specifying baseurl. -build:production:subpath:prformance: +build:production:subpath:performance: <<: *builds_performance <<: *production_before_script image: ruby:latest @@ -195,7 +203,7 @@ build:production:subpath:prformance: # Job runs jekyll build with production dependencies, # puts everything in a sub-directory as required for review apps. -build:production:review-apps:prformance: +build:production:review-apps:performance: <<: *builds_performance <<: *production_before_script variables: -- GitLab From 17c55391a036f99191a52537e5288bcd3cad2de0 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 19:46:47 +0100 Subject: [PATCH 18/21] [WIP] Try "rules" without "when: always" --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae26a6f..7ca27cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -93,7 +93,6 @@ stages: rules: # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" || $USE_HPC_RESOURCES != "1"' - if: '$USE_HPC_RESOURCES != "1"' - when: always .builds_performance: &builds_performance stage: build @@ -110,7 +109,6 @@ stages: rules: # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - if: '$USE_HPC_RESOURCES == "1"' - when: always .tests: &tests stage: test -- GitLab From 8de6d8fabd1feb6a2c602ce31a153d018eb0e0c2 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Tue, 11 Feb 2020 19:46:47 +0100 Subject: [PATCH 19/21] [WIP] Try "rules" without "when: always" --- .gitlab-ci.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae26a6f..25a74b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ image: ruby:2.6.5 stages: + - hpc_use - build - test - review @@ -48,15 +49,18 @@ stages: - ./.gitlab/**/* - ./assets/**/* -.common_production: &production_before_script +.determine_use_hpc_resources: &determine_use_hpc_resources before_script: - - 'gem install bundler --no-document' - - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' - 'export JOB_START_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")' - 'export JOB_START_SECONDS=$(date +%s -d"$JOB_START_TIMESTAMP")' - 'export USE_HPC_RESOURCES_UNTIL_SECONDS=$(date +%s -d"$USE_HPC_RESOURCES_UNTIL_TIMESTAMP")' - 'if [[ "$JOB_START_SECONDS" -lt "$USE_HPC_RESOURCES_UNTIL_SECONDS" ]]; then USE_HPC_RESOURCES=1; else USE_HPC_RESOURCES=0; fi' - 'echo "USE_HPC_RESOURCES: $USE_HPC_RESOURCES until: $USE_HPC_RESOURCES_UNTIL_TIMESTAMP."' + +.common_production: &production_before_script + before_script: + - 'gem install bundler --no-document' + - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' <<: *cache_production .common_latest: &latest_before_script @@ -64,11 +68,6 @@ stages: - '[[ -f \"Gemfile.lock\" ]] && rm Gemfile.lock' - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' - 'bundle update --jobs $(nproc) "${FLAGS[@]}"' - - 'export JOB_START_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")' - - 'export JOB_START_SECONDS=$(date +%s -d"$JOB_START_TIMESTAMP")' - - 'export USE_HPC_RESOURCES_UNTIL_SECONDS=$(date +%s -d"$USE_HPC_RESOURCES_UNTIL_TIMESTAMP")' - - 'if [[ "$JOB_START_SECONDS" -lt "$USE_HPC_RESOURCES_UNTIL_SECONDS" ]]; then USE_HPC_RESOURCES=1; else USE_HPC_RESOURCES=0; fi' - - 'echo "USE_HPC_RESOURCES: $USE_HPC_RESOURCES until: $USE_HPC_RESOURCES_UNTIL_TIMESTAMP."' <<: *cache_latest .common_variables: &common_variables @@ -76,7 +75,7 @@ stages: SUBPATH: "/" BUNDLE_PATH: vendor/bundle NOKOGIRI_USE_SYSTEM_LIBRARIES: "1" - USE_HPC_RESOURCES_UNTIL_TIMESTAMP: "2020-02-11 20:00:00" + USE_HPC_RESOURCES_UNTIL_TIMESTAMP: "2020-02-12 10:00:00" .builds: &builds stage: build @@ -92,8 +91,7 @@ stages: <<: *use_internal_servers rules: # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" || $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES != "1"' - when: always + - if: '$USE_HPC_RESOURCES == "0"' .builds_performance: &builds_performance stage: build @@ -110,7 +108,6 @@ stages: rules: # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - if: '$USE_HPC_RESOURCES == "1"' - when: always .tests: &tests stage: test @@ -145,6 +142,14 @@ stages: interruptible: true <<: *use_internal_servers +hpc_use: + stage: hpc_use + variables: + <<: *common_variables + <<: *determine_use_hpc_resources + script: + - echo "Determine HPC usage." + # Job runs jekyll build with latest dependencies. build:latest: <<: *builds -- GitLab From be6efe4aa7a8f896a62d6026f3214b2ad69914ae Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Wed, 12 Feb 2020 09:35:02 +0100 Subject: [PATCH 20/21] Try switch to enable HPC resources during some period of time * There are two paths in CI pipeline: performance and non-performance --- .gitlab-ci.yml | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25a74b0..bab3dcb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -272,6 +272,34 @@ review: - master tags: - review-apps + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "0"' + +review:performance: + stage: review + variables: + GIT_STRATEGY: none + REVIEW_APPS_PATH: review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG + dependencies: + - build:production:review-apps:performance + needs: ["build:production:review-apps:performance"] + script: + - mkdir -p /var/www/html/gl-review-apps/$REVIEW_APPS_PATH + - rsync -a --delete ./public/$REVIEW_APPS_PATH/. /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 + only: + - branches + except: + - master + tags: + - review-apps + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "1"' stop_review: stage: review @@ -305,6 +333,28 @@ pages: - .only_extension - .artifacts_extension <<: *use_internal_servers + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "0"' + +pages:performance: + stage: deploy + dependencies: + - build:production:subpath:performance + before_script: + - echo "Skip before_script section." + script: + # Move content from subdirectory to public folder to properly support + # GitLab pages. + - mv public/$CI_PROJECT_NAME/* public/. + - rm -rf public/$CI_PROJECT_NAME + extends: + - .only_extension + - .artifacts_extension + <<: *use_internal_servers + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "1"' production: stage: deploy @@ -339,3 +389,43 @@ production: <<: *use_internal_servers extends: - .only_extension + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "0"' + +production:performance: + stage: deploy + image: debian:stable + dependencies: + - build:production:performance + variables: + GIT_STRATEGY: none + before_script: + - apt-get -qy update && apt-get -qy install rsync + # Install ssh-agent if not already installed, it is required by Docker. + # (change apt-get to yum if you use a CentOS-based image) + - 'which ssh-agent || ( apt-get -y install openssh-client )' + + # Run ssh-agent (inside the build environment) + - eval $(ssh-agent -s) + + # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store + - ssh-add <(echo "$SSH_PRIVATE_KEY") + + # In order to properly check the server's host key, assuming you created the + # SSH_SERVER_HOSTKEYS variable previously, uncomment the following two lines + # instead. + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts' + script: + - | + for server in $PRODUCTION_SERVERS + do + rsync --delete -a --chown gitlabci:www-data public/. $server:/var/www/html/software.hifis.net/. + done + <<: *use_internal_servers + extends: + - .only_extension + rules: + # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' + - if: '$USE_HPC_RESOURCES == "1"' \ No newline at end of file -- GitLab From 5cd53610a9614944cd5256dc985fa830ae42c542 Mon Sep 17 00:00:00 2001 From: Christian Hueser Date: Wed, 12 Feb 2020 09:40:00 +0100 Subject: [PATCH 21/21] Revert to previous state befor introducing hpc switch * HPC switch does not work because it is determined when all jobs had been scheduled already. --- .gitlab-ci.yml | 178 ++----------------------------------------------- 1 file changed, 5 insertions(+), 173 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bab3dcb..e1d1fdb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ image: ruby:2.6.5 stages: - - hpc_use - build - test - review @@ -33,10 +32,6 @@ stages: tags: - internal -.use_performance_servers: &use_performance_servers - tags: - - performance - # https://docs.gitlab.com/ce/ci/yaml/#onlychangesexceptchanges .only_if_html_md_or_yml_changed: &only_if_html_md_or_yml_changed only: @@ -49,25 +44,17 @@ stages: - ./.gitlab/**/* - ./assets/**/* -.determine_use_hpc_resources: &determine_use_hpc_resources - before_script: - - 'export JOB_START_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")' - - 'export JOB_START_SECONDS=$(date +%s -d"$JOB_START_TIMESTAMP")' - - 'export USE_HPC_RESOURCES_UNTIL_SECONDS=$(date +%s -d"$USE_HPC_RESOURCES_UNTIL_TIMESTAMP")' - - 'if [[ "$JOB_START_SECONDS" -lt "$USE_HPC_RESOURCES_UNTIL_SECONDS" ]]; then USE_HPC_RESOURCES=1; else USE_HPC_RESOURCES=0; fi' - - 'echo "USE_HPC_RESOURCES: $USE_HPC_RESOURCES until: $USE_HPC_RESOURCES_UNTIL_TIMESTAMP."' - .common_production: &production_before_script before_script: - - 'gem install bundler --no-document' - - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' + - gem install bundler --no-document + - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" <<: *cache_production .common_latest: &latest_before_script before_script: - - '[[ -f \"Gemfile.lock\" ]] && rm Gemfile.lock' - - 'bundle install --jobs $(nproc) --without test "${FLAGS[@]}"' - - 'bundle update --jobs $(nproc) "${FLAGS[@]}"' + - "[[ -f \"Gemfile.lock\" ]] && rm Gemfile.lock" + - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" + - bundle update --jobs $(nproc) "${FLAGS[@]}" <<: *cache_latest .common_variables: &common_variables @@ -75,7 +62,6 @@ stages: SUBPATH: "/" BUNDLE_PATH: vendor/bundle NOKOGIRI_USE_SYSTEM_LIBRARIES: "1" - USE_HPC_RESOURCES_UNTIL_TIMESTAMP: "2020-02-12 10:00:00" .builds: &builds stage: build @@ -89,25 +75,6 @@ stages: # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true <<: *use_internal_servers - rules: -# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" || $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "0"' - -.builds_performance: &builds_performance - stage: build - variables: - <<: *common_variables - script: - - "bundle exec jekyll build --future \ - -d public$SUBPATH \ - --baseurl $SUBPATH" - - "bash ./scripts/copy_favicons.bash \"_favicons/\" \"public/\" $SUBPATH" - # https://docs.gitlab.com/ce/ci/yaml/#interruptible - interruptible: true - <<: *use_performance_servers - rules: -# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "1"' .tests: &tests stage: test @@ -142,14 +109,6 @@ stages: interruptible: true <<: *use_internal_servers -hpc_use: - stage: hpc_use - variables: - <<: *common_variables - <<: *determine_use_hpc_resources - script: - - echo "Determine HPC usage." - # Job runs jekyll build with latest dependencies. build:latest: <<: *builds @@ -187,43 +146,6 @@ build:production: extends: - .artifacts_extension -# Job runs jekyll build with latest dependencies. -build:latest:performance: - <<: *builds_performance - <<: *latest_before_script - image: ruby:latest - allow_failure: true - -# Job runs jekyll build latest dependencies, -# puts everything in a sub-directory while specifying baseurl. -build:production:subpath:performance: - <<: *builds_performance - <<: *production_before_script - image: ruby:latest - variables: - <<: *common_variables - SUBPATH: /$CI_PROJECT_NAME - extends: - - .artifacts_extension - -# Job runs jekyll build with production dependencies, -# puts everything in a sub-directory as required for review apps. -build:production:review-apps:performance: - <<: *builds_performance - <<: *production_before_script - variables: - <<: *common_variables - SUBPATH: /review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG - extends: - - .artifacts_extension - -# Job runs jekyll build with current production dependencies -build:production:prformance: - <<: *builds_performance - <<: *production_before_script - extends: - - .artifacts_extension - # Job runs htmlproofer basing on production build. test:htmlproofer: <<: *tests @@ -272,34 +194,6 @@ review: - master tags: - review-apps - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "0"' - -review:performance: - stage: review - variables: - GIT_STRATEGY: none - REVIEW_APPS_PATH: review-apps/$CI_PROJECT_PATH_SLUG/$CI_COMMIT_REF_SLUG - dependencies: - - build:production:review-apps:performance - needs: ["build:production:review-apps:performance"] - script: - - mkdir -p /var/www/html/gl-review-apps/$REVIEW_APPS_PATH - - rsync -a --delete ./public/$REVIEW_APPS_PATH/. /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 - only: - - branches - except: - - master - tags: - - review-apps - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "1"' stop_review: stage: review @@ -333,28 +227,6 @@ pages: - .only_extension - .artifacts_extension <<: *use_internal_servers - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "0"' - -pages:performance: - stage: deploy - dependencies: - - build:production:subpath:performance - before_script: - - echo "Skip before_script section." - script: - # Move content from subdirectory to public folder to properly support - # GitLab pages. - - mv public/$CI_PROJECT_NAME/* public/. - - rm -rf public/$CI_PROJECT_NAME - extends: - - .only_extension - - .artifacts_extension - <<: *use_internal_servers - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "1"' production: stage: deploy @@ -389,43 +261,3 @@ production: <<: *use_internal_servers extends: - .only_extension - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "0"' - -production:performance: - stage: deploy - image: debian:stable - dependencies: - - build:production:performance - variables: - GIT_STRATEGY: none - before_script: - - apt-get -qy update && apt-get -qy install rsync - # Install ssh-agent if not already installed, it is required by Docker. - # (change apt-get to yum if you use a CentOS-based image) - - 'which ssh-agent || ( apt-get -y install openssh-client )' - - # Run ssh-agent (inside the build environment) - - eval $(ssh-agent -s) - - # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store - - ssh-add <(echo "$SSH_PRIVATE_KEY") - - # In order to properly check the server's host key, assuming you created the - # SSH_SERVER_HOSTKEYS variable previously, uncomment the following two lines - # instead. - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts' - script: - - | - for server in $PRODUCTION_SERVERS - do - rsync --delete -a --chown gitlabci:www-data public/. $server:/var/www/html/software.hifis.net/. - done - <<: *use_internal_servers - extends: - - .only_extension - rules: - # - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" && $USE_HPC_RESOURCES != "1"' - - if: '$USE_HPC_RESOURCES == "1"' \ No newline at end of file -- GitLab