Skip to content

Commit

Permalink
Merge pull request #5313 from ipfs/fix/ci/build-timeout
Browse files Browse the repository at this point in the history
ci: apply timeout for build steps after getting node
  • Loading branch information
whyrusleeping authored Aug 2, 2018
2 parents 00c422f + cb60ff7 commit d0a1cee
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ def setupStep(nodeLabel, f) {
}
}

def gobuild_step(list) {
def gobuild_step = { list ->
setupStep('linux') { run ->
run "make gx-deps"
timeout(time: build_timeout, unit: 'MINUTES') {
run "make gx-deps"

list.each { platform ->
withEnv(["GOOS=${platform[0]}", "GOARCH=${platform[1]}"]) {
run "go build -i -ldflags=\"-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=${env.SUBNAME}-${env.BUILD_NUMBER}\" -o cmd/ipfs/ipfs github.com/ipfs/go-ipfs/cmd/ipfs"
run "cp cmd/ipfs/ipfs cmd/ipfs/dist; cd cmd/ipfs/dist; tar -czvf ../go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz ."
archiveArtifacts artifacts: "cmd/ipfs/go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz", fingerprint: true
list.each { platform ->
timeout(time: check_timeout, unit: 'MINUTES') {
withEnv(["GOOS=${platform[0]}", "GOARCH=${platform[1]}"]) {
run "go build -i -ldflags=\"-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=${env.SUBNAME}-${env.BUILD_NUMBER}\" -o cmd/ipfs/ipfs github.com/ipfs/go-ipfs/cmd/ipfs"
run "cp cmd/ipfs/ipfs cmd/ipfs/dist; cd cmd/ipfs/dist; tar -czvf ../go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz ."
archiveArtifacts artifacts: "cmd/ipfs/go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz", fingerprint: true
}
}
}
}
}
Expand Down Expand Up @@ -111,19 +115,15 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) {
}
},
'go build': {
timeout(time: check_timeout, unit: 'MINUTES') {
gobuild_step(fast_build_platforms)
}
gobuild_step(fast_build_platforms)
}
)
}

stage('Tests') {
parallel(
'go build (other platforms)': {
timeout(time: build_timeout, unit: 'MINUTES') {
gobuild_step(build_platforms)
}
gobuild_step(build_platforms)
},
windows: {
setupStep('windows') { run ->
Expand Down

0 comments on commit d0a1cee

Please sign in to comment.