Skip to content

Commit b4f14a3

Browse files
Rolika4SergK
authored andcommitted
fix: Use branch name instead of SHA for tagging (#596)
1 parent 0e9e25c commit b4f14a3

26 files changed

+128
-26
lines changed

charts/pipelines-library/templates/pipelines/autotests/gradle/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
description: 'git revision to checkout (branch, tag, sha, ref…)'
3939
default: "edp"
4040
type: string
41+
- name: targetBranch
42+
description: 'Target branch of Merge Request'
43+
default: "main"
44+
type: string
4145
- name: CODEBASE_NAME
4246
default: '{{ $framework }}-gradle'
4347
description: "Project name"
@@ -81,7 +85,7 @@ spec:
8185
- init-values
8286
params:
8387
- name: BRANCH_NAME
84-
value: $(params.git-source-revision)
88+
value: $(params.targetBranch)
8589
- name: BASE_IMAGE
8690
value: $(params.image)
8791

charts/pipelines-library/templates/pipelines/autotests/maven/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ spec:
4040
description: 'git revision to checkout (branch, tag, sha, ref…)'
4141
default: "edp"
4242
type: string
43+
- name: targetBranch
44+
description: 'Target branch of Merge Request'
45+
default: "main"
46+
type: string
4347
- name: CODEBASE_NAME
4448
default: '{{ $framework }}-maven'
4549
description: "Project name"
@@ -83,7 +87,7 @@ spec:
8387
- init-values
8488
params:
8589
- name: BRANCH_NAME
86-
value: $(params.git-source-revision)
90+
value: $(params.targetBranch)
8791
- name: BASE_IMAGE
8892
value: $(params.image)
8993

charts/pipelines-library/templates/pipelines/c/cmake/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "master"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
default: "make-c"
3337
description: "Project name"
@@ -73,7 +77,7 @@ spec:
7377
- init-values
7478
params:
7579
- name: BRANCH_NAME
76-
value: $(params.git-source-revision)
80+
value: $(params.targetBranch)
7781

7882

7983
{{- include "c-cmake-build-common" $ | nindent 4 }}

charts/pipelines-library/templates/pipelines/c/make/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "master"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
default: "make-c"
3337
description: "Project name"
@@ -73,7 +77,7 @@ spec:
7377
- init-values
7478
params:
7579
- name: BRANCH_NAME
76-
value: $(params.git-source-revision)
80+
value: $(params.targetBranch)
7781

7882

7983
{{- include "c-make-build-common" $ | nindent 4 }}

charts/pipelines-library/templates/pipelines/docker/kaniko/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "edp"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
default: 'docker-kaniko'
3337
description: "Project name"
@@ -69,7 +73,7 @@ spec:
6973
- init-values
7074
params:
7175
- name: BRANCH_NAME
72-
value: $(params.git-source-revision)
76+
value: $(params.targetBranch)
7377

7478

7579
- name: dockerfile-lint

charts/pipelines-library/templates/pipelines/go/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ spec:
3232
description: 'git revision to checkout (branch, tag, sha, ref…)'
3333
default: "master"
3434
type: string
35+
- name: targetBranch
36+
description: 'Target branch of Merge Request'
37+
default: "main"
38+
type: string
3539
- name: CODEBASE_NAME
3640
default: "{{ $framework }}-go"
3741
description: "Project name"
@@ -77,7 +81,7 @@ spec:
7781
- init-values
7882
params:
7983
- name: BRANCH_NAME
80-
value: $(params.git-source-revision)
84+
value: $(params.targetBranch)
8185

8286
{{- include "get-cache" $ | nindent 4 }}
8387

charts/pipelines-library/templates/pipelines/groovy/gitlab-build-lib-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "master"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
default: 'groovy-pipeline'
3337
description: "Project name"
@@ -73,7 +77,7 @@ spec:
7377
- init-values
7478
params:
7579
- name: BRANCH_NAME
76-
value: $(params.git-source-revision)
80+
value: $(params.targetBranch)
7781
- name: BASE_IMAGE
7882
value: $(params.image)
7983

charts/pipelines-library/templates/pipelines/helm-pipelines/gitlab-build-lib-default.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "edp"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
description: "Project name"
3337
type: string
@@ -88,7 +92,7 @@ spec:
8892
value: "Build Pipeline"
8993
- name: "DESCRIPTION"
9094
value: "IN PROGRESS"
91-
95+
9296
- name: fetch-repository
9397
taskRef:
9498
kind: Task
@@ -114,7 +118,7 @@ spec:
114118
- fetch-repository
115119
params:
116120
- name: BRANCH_NAME
117-
value: $(params.git-source-revision)
121+
value: $(params.targetBranch)
118122

119123
- name: helm-dependency-update
120124
taskRef:

charts/pipelines-library/templates/pipelines/infrastructure/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ spec:
2828
description: 'git revision to checkout (branch, tag, sha, ref…)'
2929
default: "master"
3030
type: string
31+
- name: targetBranch
32+
description: 'Target branch of Merge Request'
33+
default: "main"
34+
type: string
3135
- name: CODEBASE_NAME
3236
default: 'terraform-terraform'
3337
description: "Project name"
@@ -70,7 +74,7 @@ spec:
7074
- init-values
7175
params:
7276
- name: BRANCH_NAME
73-
value: $(params.git-source-revision)
77+
value: $(params.targetBranch)
7478

7579
{{- include "terraform-check-build-common" . | nindent 4 }}
7680

charts/pipelines-library/templates/pipelines/java/gradle/gitlab-build-default.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ spec:
3939
description: 'git revision to checkout (branch, tag, sha, ref…)'
4040
default: "edp"
4141
type: string
42+
- name: targetBranch
43+
description: 'Target branch of Merge Request'
44+
default: "main"
45+
type: string
4246
- name: CODEBASE_NAME
4347
default: '{{ $framework }}-gradle'
4448
description: "Project name"
@@ -88,7 +92,7 @@ spec:
8892
- init-values
8993
params:
9094
- name: BRANCH_NAME
91-
value: $(params.git-source-revision)
95+
value: $(params.targetBranch)
9296
- name: BASE_IMAGE
9397
value: $(params.image)
9498

0 commit comments

Comments
 (0)