Skip to content

Commit b316009

Browse files
committed
Update Jenkinsfile
1 parent b93e2ba commit b316009

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

demo/repo/Jenkinsfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@ node {
1111
def imagetag = "${version.trim()}.${env.BUILD_ID}"
1212

1313
// Run the build and unit tests inside a maven container
14+
stage 'build java artifacts'
1415
buildWithMavenContainer('demo/repo/javademo', imagetag)
1516

1617
// Build the Docker images for the app and integration test
1718
// from the artifacts built in the workspace
19+
stage 'build docker images'
1820
def images = buildDockerImages('demo/repo/javademo', imagetag)
1921

2022
// Start Docker app/test containers for integration testing
23+
stage 'run integration tests'
2124
runIntegrationTests(images[0], images[1], imagetag)
2225

2326
// Publish the Docker images to a Docker registry
27+
stage 'push docker images'
2428
publishDockerImages(images[0], images[1], imagetag)
2529
}
2630
catch (all)
@@ -157,6 +161,16 @@ def runIntegrationTests(appimage, testimage, imagetag)
157161
}
158162
}
159163

164+
def pushImage(image) {
165+
166+
try {
167+
// temporariy use fully qualified VDR name; shorter ose3vdr1 should be used once devops docker changes made
168+
docker.script.sh "docker tag ${image} ose3vdr1.services.slogvpc4.caplatformdev.com:5000/platform/${image}"
169+
docker.script.sh "docker push ose3vdr1.services.slogvpc4.caplatformdev.com:5000/platform/${image}"
170+
}
171+
catch (all) {error "Failed to tag/push to VDR image ${image}"}
172+
}
173+
160174
// Publish Docker images to a registry only when build parameter is set
161175
def publishDockerImages(appimage, testimage, imagetag)
162176
{

0 commit comments

Comments
 (0)