Skip to content

Commit 33caa04

Browse files
committed
jenkins > create hivemq branch as fallback
1 parent d0d9f81 commit 33caa04

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

CompositeJenkinsfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ pipeline {
44
// by default run on the master node, since it's the only one with direct repo access
55
agent { label 'master' }
66
options {
7-
// no checkout needed
8-
skipDefaultCheckout()
7+
skipDefaultCheckout() // no checkout needed
98
buildDiscarder(logRotator(numToKeepStr: '100'))
109
timestamps()
1110
}
@@ -17,7 +16,16 @@ pipeline {
1716
try {
1817
build job: "../../hivemq4-composite/${branchJobName}", wait: false
1918
} catch (e) {
20-
build job: "../../hivemq4-composite", wait: false
19+
try {
20+
sh """
21+
git clone git@github.com:hivemq/hivemq.git --branch=${PLATFORM_MASTER} --single-branch --depth 1 .
22+
git push origin HEAD:${BRANCH_NAME}
23+
"""
24+
} catch (e2) { // if push failed, branch already exists
25+
} finally {
26+
cleanWs()
27+
build job: "../../hivemq4-composite", wait: false
28+
}
2129
}
2230
}
2331
}

0 commit comments

Comments
 (0)