Skip to content

Commit 324d661

Browse files
committed
[Docker-Images] Skip default checkout and limit registry availability
1 parent 2f91e81 commit 324d661

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
pipeline {
22
options {
3+
skipDefaultCheckout()
4+
timestamps()
35
timeout(time: 2, unit: 'HOURS')
46
buildDiscarder(logRotator(numToKeepStr:'5'))
57
disableConcurrentBuilds(abortPrevious: true)
6-
timestamps()
78
}
89
triggers {
910
cron '@weekly'
@@ -64,12 +65,10 @@ pipeline {
6465
}
6566

6667
def buildAndPushImage(directory, imageId) {
67-
withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
68-
sh """
69-
pushd ${directory}
70-
docker build --pull -t ${imageId} .
71-
docker push ${imageId}
72-
popd
73-
"""
68+
dir(directory) {
69+
sh "docker build --pull -t ${imageId} ."
70+
withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
71+
sh "docker push ${imageId}"
72+
}
7473
}
7574
}

0 commit comments

Comments
 (0)