Skip to content

Commit 3a65800

Browse files
committed
libcouchbase: allow to specify artifact selector for repo builder
1 parent 659d5e9 commit 3a65800

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

libcouchbase/Jenkinsfile.repo.erb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
%>
33
// DO NOT EDIT: this file was generated from Jenkinsfile.repo.erb
44

5-
<%
6-
selector = "specific('199')"
7-
selector = 'upstream()'
8-
%>
9-
105
pipeline {
116
agent none
127
stages {
@@ -31,7 +26,7 @@ key_url = "https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key"
3126
agent { label 'centos7-signing' }
3227
steps {
3328
cleanWs()
34-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: <%= selector %>, filter: 'libcouchbase-*<%= distro %>*.tar')
29+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*<%= distro %>*.tar')
3530
writeFile(file: "rpmsign-wrapper.expect", text: """
3631
set pkgName [lrange \$argv 0 0]
3732
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -91,7 +86,7 @@ key_url = "https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key"
9186
agent { label 'debian10-signing' }
9287
steps {
9388
cleanWs()
94-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: <%= selector %>, filter: 'libcouchbase-*<%= distro %>*.tar')
89+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*<%= distro %>*.tar')
9590
sh('mkdir -p <%= repo_dir %>/conf')
9691
writeFile(file: "<%= repo_dir %>/conf/distributions", text: """
9792
Origin: couchbase

libcouchbase/lcb-repo-pipeline.groovy

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
// DO NOT EDIT: this file was generated from Jenkinsfile.repo.erb
33

4-
5-
64
pipeline {
75
agent none
86
stages {
@@ -14,7 +12,7 @@ pipeline {
1412
agent { label 'centos7-signing' }
1513
steps {
1614
cleanWs()
17-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*centos7*.tar')
15+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*centos7*.tar')
1816
writeFile(file: "rpmsign-wrapper.expect", text: """
1917
set pkgName [lrange \$argv 0 0]
2018
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -57,7 +55,7 @@ gpgkey = https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key
5755
agent { label 'centos7-signing' }
5856
steps {
5957
cleanWs()
60-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*rhel8*.tar')
58+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*rhel8*.tar')
6159
writeFile(file: "rpmsign-wrapper.expect", text: """
6260
set pkgName [lrange \$argv 0 0]
6361
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -100,7 +98,7 @@ gpgkey = https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key
10098
agent { label 'centos7-signing' }
10199
steps {
102100
cleanWs()
103-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*rhel9*.tar')
101+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*rhel9*.tar')
104102
writeFile(file: "rpmsign-wrapper.expect", text: """
105103
set pkgName [lrange \$argv 0 0]
106104
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -143,7 +141,7 @@ gpgkey = https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key
143141
agent { label 'centos7-signing' }
144142
steps {
145143
cleanWs()
146-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*amzn2*.tar')
144+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*amzn2*.tar')
147145
writeFile(file: "rpmsign-wrapper.expect", text: """
148146
set pkgName [lrange \$argv 0 0]
149147
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -186,7 +184,7 @@ gpgkey = https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key
186184
agent { label 'centos7-signing' }
187185
steps {
188186
cleanWs()
189-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*amzn2*.tar')
187+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*amzn2*.tar')
190188
writeFile(file: "rpmsign-wrapper.expect", text: """
191189
set pkgName [lrange \$argv 0 0]
192190
spawn rpm --addsign -D "_signature gpg" -D "_gpg_name ${GPG_NAME}" \$pkgName
@@ -230,7 +228,7 @@ gpgkey = https://sdk-snapshots.couchbase.com/libcouchbase/couchbase.key
230228
agent { label 'debian10-signing' }
231229
steps {
232230
cleanWs()
233-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*jammy*.tar')
231+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*jammy*.tar')
234232
sh('mkdir -p repo/ubuntu2204/conf')
235233
writeFile(file: "repo/ubuntu2204/conf/distributions", text: """
236234
Origin: couchbase
@@ -267,7 +265,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/ubuntu2204 jammy jammy/main
267265
agent { label 'debian10-signing' }
268266
steps {
269267
cleanWs()
270-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*bullseye*.tar')
268+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*bullseye*.tar')
271269
sh('mkdir -p repo/debian11/conf')
272270
writeFile(file: "repo/debian11/conf/distributions", text: """
273271
Origin: couchbase
@@ -304,7 +302,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/debian11 bullseye bullseye/
304302
agent { label 'debian10-signing' }
305303
steps {
306304
cleanWs()
307-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*focal*.tar')
305+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*focal*.tar')
308306
sh('mkdir -p repo/ubuntu2004/conf')
309307
writeFile(file: "repo/ubuntu2004/conf/distributions", text: """
310308
Origin: couchbase
@@ -341,7 +339,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/ubuntu2004 focal focal/main
341339
agent { label 'debian10-signing' }
342340
steps {
343341
cleanWs()
344-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*buster*.tar')
342+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*buster*.tar')
345343
sh('mkdir -p repo/debian10/conf')
346344
writeFile(file: "repo/debian10/conf/distributions", text: """
347345
Origin: couchbase
@@ -378,7 +376,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/debian10 buster buster/main
378376
agent { label 'debian10-signing' }
379377
steps {
380378
cleanWs()
381-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*bionic*.tar')
379+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*bionic*.tar')
382380
sh('mkdir -p repo/ubuntu1804/conf')
383381
writeFile(file: "repo/ubuntu1804/conf/distributions", text: """
384382
Origin: couchbase
@@ -415,7 +413,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/ubuntu1804 bionic bionic/ma
415413
agent { label 'debian10-signing' }
416414
steps {
417415
cleanWs()
418-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*stretch*.tar')
416+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*stretch*.tar')
419417
sh('mkdir -p repo/debian9/conf')
420418
writeFile(file: "repo/debian9/conf/distributions", text: """
421419
Origin: couchbase
@@ -452,7 +450,7 @@ deb https://sdk-snapshots.couchbase.com/libcouchbase/debian9 stretch stretch/mai
452450
agent { label 'debian10-signing' }
453451
steps {
454452
cleanWs()
455-
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: upstream(), filter: 'libcouchbase-*xenial*.tar')
453+
copyArtifacts(projectName: 'lcb-lnx-scripted-build-pipeline', selector: UPSTREAM_BUILD.isEmpty() ? upstream() : specific(UPSTREAM_BUILD), filter: 'libcouchbase-*xenial*.tar')
456454
sh('mkdir -p repo/ubuntu1604/conf')
457455
writeFile(file: "repo/ubuntu1604/conf/distributions", text: """
458456
Origin: couchbase

0 commit comments

Comments
 (0)