This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathJenkinsfile
80 lines (74 loc) · 2.58 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
def utils = new io.fabric8.Utils()
def initServiceGitHash
def releaseVersion
//def commitMsg
goTemplate{
dockerNode{
ws {
checkout scm
if (utils.isCI()){
def v = goCI{
githubOrganisation = 'fabric8-services'
dockerOrganisation = 'fabric8'
project = 'fabric8-notification'
dockerBuildOptions = '--file Dockerfile.deploy'
makeTarget = 'build test-unit-no-coverage-junit'
}
sh('mv /home/jenkins/go/src/github.com/fabric8-services/fabric8-notification/tmp/junit.xml `pwd`')
junit 'junit.xml'
/*
container(name: "docker") {
sh "docker tag docker.io/fabric8/fabric8-notification:${v} registry.devshift.net/fabric8-services/fabric8-notification:test"
sh "docker push registry.devshift.net/fabric8-services/fabric8-notification:test"
}
*/
} else if (utils.isCD()){
def v = goRelease{
githubOrganisation = 'fabric8-services'
dockerOrganisation = 'fabric8'
project = 'fabric8-notification'
dockerBuildOptions = '--file Dockerfile.deploy'
makeTarget = 'build test-unit-no-coverage-junit'
}
initServiceGitHash = sh(script: 'git rev-parse HEAD', returnStdout: true).toString().trim()
}
}
// if (utils.isCD()){
// ws{
// container(name: 'go') {
// def gitRepo = 'openshiftio/saas-openshiftio'
// def flow = new io.fabric8.Fabric8Commands()
// sh 'chmod 600 /root/.ssh-git/ssh-key'
// sh 'chmod 600 /root/.ssh-git/ssh-key.pub'
// sh 'chmod 700 /root/.ssh-git'
//
// git "[email protected]:${gitRepo}"
//
// sh "git config user.email [email protected]"
// sh "git config user.name fabric8-cd"
//
// def uid = UUID.randomUUID().toString()
// def branch = "versionUpdate${uid}"
// sh "git checkout -b ${branch}"
//
// sh "sed -i -r 's/- hash: .*/- hash: ${initServiceGitHash}/g' dsaas-services/f8-notification.yaml"
//
// commitMsg = sh(script: 'git log --format=%B -n 1 HEAD', returnStdout: true).
// def message = """Update notification version to ${releaseVersion}
//
// ```
// ${commitMsg}
// ```
// """
// sh "git commit -a -m \"${message}\""
// sh "git push origin ${branch}"
//
// def prId = flow.createPullRequest(message, gitRepo, branch)
// flow.mergePR(gitRepo, prId)
// }
// }
// }
}
}