@@ -2,7 +2,7 @@ properties([buildDiscarder(logRotator(numToKeepStr: '20'))])
22
33pipeline {
44 agent {
5- label ' pipeline '
5+ label ' linux && x86_64 '
66 }
77
88 options {
@@ -14,7 +14,7 @@ pipeline {
1414 parallel {
1515 stage(" Validate" ) {
1616 agent {
17- label ' linux '
17+ label ' ubuntu-1604-aufs-edge '
1818 }
1919 steps {
2020 dir(' src/github.com/docker/app' ) {
@@ -26,7 +26,7 @@ pipeline {
2626 }
2727 stage(" Binaries" ){
2828 agent {
29- label ' linux '
29+ label ' ubuntu-1604-aufs-edge '
3030 }
3131 steps {
3232 dir(' src/github.com/docker/app' ) {
@@ -62,25 +62,19 @@ pipeline {
6262 stage(' Test' ) {
6363 parallel {
6464 stage(" Coverage" ) {
65- environment {
66- CODECOV_TOKEN = credentials(' jenkins-codecov-token' )
67- }
6865 agent {
69- label ' linux '
66+ label ' ubuntu-1604-aufs-edge '
7067 }
7168 steps {
7269 dir(' src/github.com/docker/app' ) {
7370 checkout scm
7471 sh ' make -f docker.Makefile coverage'
75- archiveArtifacts ' _build/ci-cov/all.out'
76- archiveArtifacts ' _build/ci-cov/coverage.html'
77- sh ' curl -s https://codecov.io/bash | bash -s - -f _build/ci-cov/all.out -K'
7872 }
7973 }
8074 }
8175 stage(" Gradle test" ) {
8276 agent {
83- label ' linux '
77+ label ' ubuntu-1604-aufs-edge '
8478 }
8579 steps {
8680 dir(' src/github.com/docker/app' ) {
@@ -99,7 +93,7 @@ pipeline {
9993 }
10094 stage(" Test Linux" ) {
10195 agent {
102- label ' linux '
96+ label ' ubuntu-1604-aufs-edge '
10397 }
10498 steps {
10599 dir(' src/github.com/docker/app' ) {
@@ -114,74 +108,9 @@ pipeline {
114108 }
115109 }
116110 }
117- stage(" Test Mac" ) {
118- agent {
119- label " mac"
120- }
121- steps {
122- dir(' src/github.com/docker/app' ) {
123- unstash ' binaries'
124- unstash ' e2e'
125- sh ' ./docker-app-e2e-darwin'
126- }
127- }
128- post {
129- always {
130- deleteDir()
131- }
132- }
133- }
134- stage(" Test Win" ) {
135- agent {
136- label " windows"
137- }
138- steps {
139- dir(' src/github.com/docker/app' ) {
140- unstash " binaries"
141- unstash ' e2e'
142- bat ' docker-app-e2e-windows.exe'
143- }
144- }
145- post {
146- always {
147- deleteDir()
148- }
149- }
150- }
151- }
152- }
153- stage(' Release' ) {
154- agent {
155- label " linux"
156- }
157- when {
158- buildingTag()
159- }
160- steps {
161- dir(' src/github.com/docker/app' ) {
162- unstash ' artifacts'
163- echo " Releasing $TAG_NAME "
164- dir(' bin' ) {
165- release(' docker/app' )
166- }
167- }
168- }
169- post {
170- always {
171- deleteDir()
172- }
173111 }
174112 }
175113 }
176114}
177115
178- def release (repo ) {
179- withCredentials([[$class : ' StringBinding' , credentialsId : ' github-release-token' , variable : ' GITHUB_TOKEN' ]]) {
180- def data = " {\" tag_name\" : \" $TAG_NAME \" , \" name\" : \" $TAG_NAME \" , \" draft\" : true, \" prerelease\" : true}"
181- def url = " https://api.github.com/repos/$repo /releases"
182- def reply = sh(returnStdout : true , script : " curl -sSf -H \" Authorization: token $GITHUB_TOKEN \" -H \" Accept: application/json\" -H \" Content-type: application/json\" -X POST -d '$data ' $url " )
183- def release = readJSON text : reply
184- url = release. upload_url. replace(' {?name,label}' , ' ' )
185- sh(" for f in * ; do curl -sf -H \" Authorization: token $GITHUB_TOKEN \" -H \" Accept: application/json\" -H \" Content-type: application/octet-stream\" -X POST --data-binary \" @\$ {f}\" $url ?name=\$ {f}; done" )
186- }
187- }
116+
0 commit comments