Skip to content

Commit

Permalink
[Docker-Images] Skip default checkout and limit registry availability
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Sep 20, 2024
1 parent 2f91e81 commit 6497918
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pipeline {
options {
skipDefaultCheckout()
timestamps()
timeout(time: 2, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr:'5'))
disableConcurrentBuilds(abortPrevious: true)
timestamps()
}
triggers {
cron '@weekly'
Expand Down Expand Up @@ -64,12 +65,10 @@ pipeline {
}

def buildAndPushImage(directory, imageId) {
withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
sh """
pushd ${directory}
docker build --pull -t ${imageId} .
docker push ${imageId}
popd
"""
dir(directory) {
sh "docker build --pull -t ${imageId} ."
withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
sh "docker push ${imageId}"
}
}
}

0 comments on commit 6497918

Please sign in to comment.