diff --git a/templates/gitlab-ci-maven.yml b/templates/gitlab-ci-maven.yml index acd3d4dcfbd9a0b0c4a134de304494833389289d..6c45c05b02365f4d0ad29a5477acd403609ec8ee 100644 --- a/templates/gitlab-ci-maven.yml +++ b/templates/gitlab-ci-maven.yml @@ -13,6 +13,14 @@ # program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth # Floor, Boston, MA 02110-1301, USA. # ========================================================================================= +# default workflow rules +workflow: + rules: + # exclude merge requests + - if: $CI_MERGE_REQUEST_ID + when: never + - when: always + variables: # variabilized tracking image TBC_TRACKING_IMAGE: "$CI_REGISTRY/to-be-continuous/tools/tracking:master" @@ -463,9 +471,6 @@ mvn-build: - "${MAVEN_PROJECT_DIR}/**/target/*-reports/TEST-*.xml" paths: - "${MAVEN_PROJECT_DIR}/**/target" - rules: - # exclude merge requests - - if: '$CI_MERGE_REQUEST_ID == null' # Sonar job mvn-sonar: @@ -481,9 +486,6 @@ mvn-sonar: - mvn ${TRACE+-Dsonar.verbose=true} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args ${SONAR_AUTH_TOKEN+-Dsonar.login=$SONAR_AUTH_TOKEN} ${SONAR_LOGIN+-Dsonar.login=$SONAR_LOGIN} ${SONAR_PASSWORD+-Dsonar.password=$SONAR_PASSWORD} $SONAR_BASE_ARGS $sonar_extra_args $sonar_mr_args - if [[ "$SONAR_QUALITY_GATE_ENABLED" == "true" ]]; then sonar_quality_gate_check; fi rules: - # exclude merge requests - - if: $CI_MERGE_REQUEST_ID - when: never # exclude if $SONAR_URL not set - if: '$SONAR_URL == null || $SONAR_URL == ""' when: never @@ -506,9 +508,6 @@ mvn-dependency-check: script: - mvn ${TRACE+-X} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args $MAVEN_DEPENDENCY_CHECK_ARGS rules: - # exclude merge requests - - if: $CI_MERGE_REQUEST_ID - when: never # on schedule: auto - if: '$CI_PIPELINE_SOURCE == "schedule"' allow_failure: true @@ -529,9 +528,6 @@ mvn-forbid-snapshot-dependencies: script: - mvn ${TRACE+-X} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce -Drules=requireReleaseDeps rules: - # exclude merge requests - - if: $CI_MERGE_REQUEST_ID - when: never # exclude if disabled - if: '$MVN_FORBID_SNAPSHOT_DEPENDENCIES_DISABLED == "true"' when: never @@ -546,9 +542,6 @@ mvn-snapshot: script: - perform_snapshot rules: - # exclude merge requests - - if: $CI_MERGE_REQUEST_ID - when: never # on tags: never - if: $CI_COMMIT_TAG when: never @@ -584,9 +577,6 @@ mvn-release: fi - mvn ${TRACE+-X} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args $scm_auth_args ${MAVEN_RELEASE_ARGS} ${semrel_args} -DscmCommentPrefix="$MAVEN_RELEASE_SCM_COMMENT_PREFIX" rules: - # exclude merge requests - - if: $CI_MERGE_REQUEST_ID - when: never # on production branch(es): manual & non-blocking if $MAVEN_DEPLOY_ENABLED is set - if: '$MAVEN_DEPLOY_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF' when: manual