Skip to content

Commit 235af78

Browse files
committed
[releng] use git branch in docker image build
1 parent 2265fde commit 235af78

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Jenkinsfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
try {
1111

1212
def currentVersion
13-
def majorVersion
1413
def revision
14+
def branch
1515
def mavenPhase = params.skipDeploy ? "verify" : "deploy"
1616

1717
slack.notifyBuild()
@@ -24,8 +24,8 @@ try {
2424

2525
pom = readMavenPom file: 'pom.xml'
2626
currentVersion = pom.version
27-
majorVersion = currentVersion.take(1)
2827
revision = sh(returnStdout: true, script: "git rev-parse --short HEAD").trim()
28+
branch = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
2929

3030
}
3131

@@ -55,13 +55,14 @@ try {
5555
string(name: 'extension', value: 'tar.gz'),
5656
string(name: 'imageClassifier', value: 'oss'),
5757
string(name: 'gitRevision', value: revision),
58+
string(name: 'gitBranch', value: branch)
5859
], quietPeriod: 1, wait: false
5960

6061
}
6162

6263
if (!params.skipDownstreamBuilds) {
6364

64-
build job: 'build-'+majorVersion+'.x/'+downstreamBuild+'', parameters: [
65+
build job: 'build-'+branch+'/'+downstreamBuild+'', parameters: [
6566
booleanParam(name: 'skipTests', value: params.skipTests),
6667
booleanParam(name: 'skipDeploy', value: params.skipDeploy),
6768
booleanParam(name: 'skipDownstreamBuilds', value: params.skipDownstreamBuilds)

0 commit comments

Comments
 (0)