This repository has been archived by the owner on Oct 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile
50 lines (43 loc) · 1.56 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
def utils = new io.fabric8.Utils()
def flow = new io.fabric8.Fabric8Commands()
clientsTemplate{
mavenNode {
try {
checkout scm
readTrusted 'release.groovy'
if (utils.isCI()) {
def version = mavenCI{ goal = "deploy" }
// hard coded for now
def mvnRepo = "https://nexus.cd.test.fabric8.io/content/repositories/staging"
def message = "PR now available for testing: Launch in [OpenShift.io](https://openshift.io/_profile/_tenant?jenkinsVersion=${version}&mavenRepo=${mvnRepo}) and click the update tenant button"
stage('notify'){
def pr = env.CHANGE_ID
if (!pr){
error "no pull request number found so cannot comment on PR"
}
container('clients'){
flow.addCommentToPullRequest(message, pr, 'fabric8-services/fabric8-tenant-jenkins')
}
}
} else if (utils.isCD()) {
sh "git remote set-url origin git@github.com:fabric8-services/fabric8-tenant-jenkins.git"
def pipeline = load 'release.groovy'
def stagedProject
stage('Stage') {
stagedProject = pipeline.stage()
}
stage('Promote') {
pipeline.release(stagedProject)
}
stage ('Update downstream dependencies'){
pipeline.updatefabric8Tenant(stagedProject[1])
}
}
} catch (err) {
hubot room: 'release', message: "${env.JOB_NAME} failed: ${err}"
error "${err}"
}
}
}