@@ -29,49 +29,57 @@ def goSlaveContainer = containerTemplate(
29
29
30
30
podTemplate(label : ' mobile-cli-go' , cloud : " openshift" , containers : [goSlaveContainer]) {
31
31
node (" mobile-cli-go" ) {
32
- sh " mkdir -p src/github.com/aerogear/mobile-cli"
33
- withEnv([" GOPATH=${ env.WORKSPACE} /" ," PATH=${ env.PATH} :${ env.WORKSPACE} /bin" ]) {
34
- dir (" src/github.com/aerogear/mobile-cli" ) {
35
- stage(" Checkout" ) {
36
- checkout scm
37
- }
32
+ withCredentials([string(
33
+ credentialsId : " coveralls_io_token" ,
34
+ variable : ' COVERALLS_TOKEN' )]) {
38
35
39
- stage (" Setup" ) {
40
- sh " glide install"
41
- }
36
+ sh " mkdir -p src/github.com/aerogear/mobile-cli"
37
+ withEnv([" GOPATH=${ env.WORKSPACE} /" ," PATH=${ env.PATH} :${ env.WORKSPACE} /bin" ]) {
38
+ dir (" src/github.com/aerogear/mobile-cli" ) {
39
+ stage(" Checkout" ) {
40
+ checkout scm
41
+ }
42
42
43
- stage (" Build" ) {
44
- sh " make build"
45
- }
46
- def project = sanitizeObjectName(" mobile-cli-${ env.CHANGE_AUTHOR} -${ env.BUILD_TAG} " )
47
- stage (" Run" ) {
48
- // workaround because of the https://issues.jboss.org/browse/FH-4471
49
- sh " mkdir -p /home/jenkins/.kube"
50
- sh " rm /home/jenkins/.kube/config || true"
51
- sh " oc config view > /home/jenkins/.kube/config"
52
- sh " oc new-project ${ project} "
53
- // end of workaround
43
+ stage (" Setup" ) {
44
+ sh " glide install"
45
+ sh " go get golang.org/x/tools/cmd/cover"
46
+ sh " go get github.com/mattn/goveralls"
47
+ }
54
48
55
- sh " ./mobile"
56
- }
57
-
49
+ stage (" Build" ) {
50
+ sh " make coveralls_build COVERALLS_TOKEN=${ COVERALLS_TOKEN} "
51
+ }
52
+
53
+ def project = sanitizeObjectName(" mobile-cli-${ env.CHANGE_AUTHOR} -${ env.BUILD_TAG} " )
54
+ stage (" Run" ) {
55
+ // workaround because of the https://issues.jboss.org/browse/FH-4471
56
+ sh " mkdir -p /home/jenkins/.kube"
57
+ sh " rm /home/jenkins/.kube/config || true"
58
+ sh " oc config view > /home/jenkins/.kube/config"
59
+ sh " oc new-project ${ project} "
60
+ // end of workaround
58
61
59
- stage (" Integration" ) {
60
- sh " oc project ${ project} "
61
- sh " go test -timeout 30m -c ./integration"
62
- sh " ./integration.test -test.short -test.v -prefix=test-${ sanitizeObjectName(env.BRANCH_NAME)} -build-$BUILD_NUMBER -namespace=`oc project -q` -executable=`pwd`/mobile"
63
- }
62
+ sh " ./mobile"
63
+ }
64
+
64
65
65
- stage (" Archive" ) {
66
- sh " mkdir out"
67
- sh " cp mobile out/"
68
- sh " cp integration.test out/"
69
- sh " cp -R integration out/integration"
70
- archiveArtifacts artifacts : ' out/**'
71
- }
66
+ stage (" Integration" ) {
67
+ sh " oc project ${ project} "
68
+ sh " go test -timeout 30m -c ./integration"
69
+ sh " ./integration.test -test.short -test.v -prefix=test-${ sanitizeObjectName(env.BRANCH_NAME)} -build-$BUILD_NUMBER -namespace=`oc project -q` -executable=`pwd`/mobile"
70
+ }
71
+
72
+ stage (" Archive" ) {
73
+ sh " mkdir out"
74
+ sh " cp mobile out/"
75
+ sh " cp integration.test out/"
76
+ sh " cp -R integration out/integration"
77
+ archiveArtifacts artifacts : ' out/**'
78
+ }
72
79
73
- stage (" Clear Project" ) {
74
- " sh oc delete project ${ project} "
80
+ stage (" Clear Project" ) {
81
+ " sh oc delete project ${ project} "
82
+ }
75
83
}
76
84
}
77
85
}
0 commit comments