github.com/abayer/test-infra@v0.0.5/Jenkinsfile (about) 1 pipeline { 2 agent { 3 label "jenkins-go" 4 } 5 stages { 6 stage('CI Build and Test') { 7 when { 8 branch 'PR-*' 9 } 10 steps { 11 dir ('/home/jenkins/go/src/k8s.io/test-infra') { 12 checkout scm 13 container('go') { 14 sh "./hack/build-then-unit.sh" 15 } 16 } 17 } 18 } 19 20 stage('Build and Release') { 21 when { 22 branch 'master' 23 } 24 steps { 25 dir ('/home/jenkins/go/src/k8s.io/test-infra') { 26 checkout scm 27 container('go') { 28 sh "git config --global credential.helper store" 29 sh "jx step git credentials" 30 sh "jx step next-version --use-git-tag-only --tag" 31 sh "./hack/build-then-unit.sh" 32 sh "./hack/jx-docker-build.sh \$(cat VERSION)" 33 } 34 } 35 } 36 } 37 } 38 }