File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ finally {
102102
103103def build (Map attrs ) {
104104 node {
105- boolean imageTagExists = sh(
106- returnStatus : true ,
107- script : " oc get istag ${ attrs.name} : ${ attrs.buildVersion} "
108- ) == 0
105+ unstash ' scripts '
106+ ansiColor( ' xterm ' ) {
107+ sh( " ./openshift/run-build.sh ${ attrs.name} ${ attrs.buildVersion} ${ attrs.gitCommitId } " )
108+ }
109109 }
110110}
111111
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -o nounset -o errexit
3+
4+ # Start a container build against a container on OpenShift. Used by the Build stage of the Jenkinsfile.
5+ # Usage: ./run-build.sh telus-isomorphic-starter-kit my-tag
6+
7+ NAME=${1}
8+ VERSION=${2}
9+ COMMIT=${3:- ' ' }
10+
11+ if oc get istag ${NAME} :${VERSION} > /dev/null 2>&1
12+ then
13+ echo " Image tag ${NAME} :${VERSION} exists... skipping build"
14+ exit 0
15+ fi
16+
17+ oc start-build ${NAME} --follow --commit=${COMMIT} --wait=true
18+
19+ oc tag ${NAME} :latest ${NAME} :${VERSION}
You can’t perform that action at this time.
0 commit comments