Skip to content

Commit b6a7408

Browse files
Rivera Gonzalez, Julio Cmythi
authored andcommitted
Push images to be published
This change, adds a conditional step on Jenkins in order to push images, built and be published. Signed-off-by: Rivera Gonzalez, Julio C <julio.c.rivera.gonzalez@intel.com>
1 parent bfcac03 commit b6a7408

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Jenkinsfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pipeline {
77
}
88
environment {
99
GO111MODULE="on"
10+
REG = "cloud-native-image-registry.westus.cloudapp.azure.com/"
1011
RUNC_VERSION="v1.0.0-rc8"
1112
CRIO_VERSION="v1.14.6"
1213
BUILDAH_VERSION="v1.10.0"
@@ -134,4 +135,16 @@ pipeline {
134135
}
135136
}
136137
}
138+
post {
139+
success {
140+
script {
141+
if (env.CHANGE_ID == null) {
142+
withDockerRegistry([ credentialsId: "57e4a8b2-ccf9-4da1-a787-76dd1aac8fd1", url: "https://${REG}" ]) {
143+
sh "make images PUSH=1"
144+
sh "make demos PUSH=1"
145+
}
146+
}
147+
}
148+
}
149+
}
137150
}

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,22 @@ export TAG
4949
images = $(shell ls build/docker/*.Dockerfile | sed 's/.*\/\(.\+\)\.Dockerfile/\1/')
5050

5151
$(images):
52+
ifndef PUSH
5253
@build/docker/build-image.sh $(REG)$@ $(BUILDER)
54+
else
55+
@docker push $(REG)$@
56+
endif
5357

5458
images: $(images)
5559

5660
demos = $(shell cd demo/ && ls -d */ | sed 's/\(.\+\)\//\1/g')
5761

5862
$(demos):
63+
ifndef PUSH
5964
@cd demo/ && ./build-image.sh $(REG)$@ $(BUILDER)
65+
else
66+
@docker push ${REG}$@
67+
endif
6068

6169
demos: $(demos)
6270

0 commit comments

Comments
 (0)