From 93d8c8758d62b26d724108eededdbc049f43342e Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Mon, 25 Sep 2023 17:57:24 +0200 Subject: [PATCH] feat(jenkins-jobs) allow disabling gittag discovery (and associated build strategy) Signed-off-by: Damien Duportal --- charts/jenkins-jobs/Chart.yaml | 2 +- charts/jenkins-jobs/templates/_helpers.tpl | 4 ++++ charts/jenkins-jobs/tests/multibranch_job_test.yaml | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/jenkins-jobs/Chart.yaml b/charts/jenkins-jobs/Chart.yaml index 6d1023abe..f37f00995 100644 --- a/charts/jenkins-jobs/Chart.yaml +++ b/charts/jenkins-jobs/Chart.yaml @@ -4,5 +4,5 @@ icon: https://jenkins.io/images/logos/plumber/256.png maintainers: - name: Damien Duportal name: jenkins-jobs -version: 0.4.0 +version: 0.5.0 appVersion: "1.0" # unused diff --git a/charts/jenkins-jobs/templates/_helpers.tpl b/charts/jenkins-jobs/templates/_helpers.tpl index d30169a51..9546680b2 100644 --- a/charts/jenkins-jobs/templates/_helpers.tpl +++ b/charts/jenkins-jobs/templates/_helpers.tpl @@ -152,7 +152,9 @@ multibranchPipelineJob('{{ .fullId | default .id }}') { strategyId(1) // 1-Merging the pull request with the current target branch revision } pruneStaleBranchTrait() + {{- if not .disableTagDiscovery }} gitHubTagDiscovery() + {{- end }} pullRequestLabelsBlackListFilterTrait { labels('on-hold,ci-skip,skip-ci') } @@ -177,10 +179,12 @@ multibranchPipelineJob('{{ .fullId | default .id }}') { {{- end }} } buildRegularBranches() + {{- if not .disableTagDiscovery }} buildTags { atLeastDays('-1') atMostDays('3') } + {{- end }} } } } diff --git a/charts/jenkins-jobs/tests/multibranch_job_test.yaml b/charts/jenkins-jobs/tests/multibranch_job_test.yaml index 8cffad06a..ac0fcabf7 100644 --- a/charts/jenkins-jobs/tests/multibranch_job_test.yaml +++ b/charts/jenkins-jobs/tests/multibranch_job_test.yaml @@ -342,6 +342,7 @@ tests: allowUntrustedChanges: true jenkinsfilePath: Jenkinsfile branchIncludes: "prod dev MR-*" + disableTagDiscovery: true asserts: - equal: path: data["jobs-definition.yaml"] @@ -386,7 +387,6 @@ tests: strategyId(1) // 1-Merging the pull request with the current target branch revision } pruneStaleBranchTrait() - gitHubTagDiscovery() pullRequestLabelsBlackListFilterTrait { labels('on-hold,ci-skip,skip-ci') } @@ -407,10 +407,6 @@ tests: ignoreUntrustedChanges(false) } buildRegularBranches() - buildTags { - atLeastDays('-1') - atMostDays('3') - } } } }