Skip to content

Commit 16e96fb

Browse files
committed
jenkins > trigger job directly
1 parent d736eea commit 16e96fb

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

CompositeJenkinsfile

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,13 @@ pipeline {
1010
timestamps()
1111
}
1212
stages {
13-
stage('Update commit id in the composite repo') {
13+
stage('Trigger build') {
1414
steps {
1515
script {
16-
commitToHiveMQCompositeRepo()
16+
def branchJobName = BRANCH_NAME.replace('/', '%2F')
17+
build job: "../../hivemq4-composite/${branchJobName}", wait: false
1718
}
1819
}
1920
}
2021
}
21-
post {
22-
cleanup {
23-
cleanWs()
24-
}
25-
}
26-
}
27-
28-
private void commitToHiveMQCompositeRepo() {
29-
def projectName = determineProjectName()
30-
def branchName = env.BRANCH_NAME
31-
def url = determineRepoUrl()
32-
sh("git clone git@github.com:hivemq/hivemq.git --branch=$PLATFORM_MASTER")
33-
dir("hivemq/") {
34-
sh("./tooling/reportScmChange.sh $branchName $url $projectName")
35-
}
36-
}
37-
38-
private String determineProjectName() {
39-
return scm.getUserRemoteConfigs()[0].getUrl().tokenize('/').last().split("\\.")[0]
40-
}
41-
42-
private String determineRepoUrl() {
43-
String repo = scm.userRemoteConfigs[0].url
44-
if (repo.startsWith("https://github.com/")) {
45-
return repo.replaceFirst("https://github.com/", "git@github.com:")
46-
} else {
47-
return repo
48-
}
4922
}

0 commit comments

Comments
 (0)