From: Frank Brehm Date: Mon, 19 Aug 2024 10:43:04 +0000 (+0200) Subject: Substituting only/except by rules in .gitlab-ci.yml X-Git-Tag: 3.3.5^2~1 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=6f35f725d63ee032b77943f5c277456bba8e7b8f;p=pixelpark%2Fcreate-vmware-tpl.git Substituting only/except by rules in .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05c0c52..5ad6fb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,7 +117,7 @@ default: - pip list --format columns - if [ -x bin/compile-xlate-msgs.sh ] ; then bin/compile-xlate-msgs.sh; fi - | - if [ "$CI_COMMIT_REF_NAME" = "master" -o "$CI_COMMIT_REF_NAME" = "production" ] ; then + if [ "$CI_COMMIT_REF_NAME" = "master" -o "$CI_COMMIT_REF_NAME" = "main" -o "$CI_COMMIT_REF_NAME" = "production" ] ; then SYSTEM_STATUS="production" elif [ "$CI_COMMIT_REF_NAME" = "test" -o "$CI_COMMIT_REF_NAME" = "testing" ] ; then SYSTEM_STATUS="testing" @@ -190,11 +190,11 @@ Test source: - which python3 - bin/create-vmware-template --version - bin/create-vmware-template --help - except: - - /^dev-.*$/ - - /^dev\/.*$/ - - /^hf.*$/ - - tags + rules: + - if: $CI_COMMIT_BRANCH =~ /^dev-.*$/ || $CI_COMMIT_BRANCH =~ /^dev\/.*$/ || $CI_COMMIT_BRANCH =~ /^hf.*$/ + when: never + - if: $CI_COMMIT_TAG + when: never Linter: extends: @@ -207,11 +207,11 @@ Linter: script: - pip install --upgrade --upgrade-strategy eager flake8 pylint - flake8 --max-line-length=$FLAKE8_MAX_LINE_LENGTH --max-complexity=$FLAKE8_MAX_COMPLEXITY --ignore=$FLAKE8_IGNORE_ERRORS bin lib - except: - - /^dev-.*$/ - - /^dev\/.*$/ - - /^hf.*$/ - - tags + rules: + - if: $CI_COMMIT_BRANCH =~ /^dev-.*$/ || $CI_COMMIT_BRANCH =~ /^dev\/.*$/ || $CI_COMMIT_BRANCH =~ /^hf.*$/ + when: never + - if: $CI_COMMIT_TAG + when: never .build-job: script: @@ -337,11 +337,14 @@ Create RHEL9 live template: VM_IS_RHEL: 'True' VM_KS_TEMPLATE: 'el9-standard.ks' COBBLER_DISTRO: 'RHEL-9.2-x86_64' - if: - - master - - main - only: - - schedules + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master" + when: on_success + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "main" + when: on_success + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "production" + when: on_success + - when: never Create RHEL9 test template: extends: @@ -359,11 +362,11 @@ Create RHEL9 test template: VM_IS_RHEL: 'True' VM_KS_TEMPLATE: 'el9-standard.ks' COBBLER_DISTRO: 'RHEL-9.2-x86_64' - if: - - test - except: - - tags - only: - - schedules + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "test" + when: on_success + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "testing" + when: on_success + - when: never # vim: et list