We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f91e81 commit 324d661Copy full SHA for 324d661
JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile
@@ -1,9 +1,10 @@
1
pipeline {
2
options {
3
+ skipDefaultCheckout()
4
+ timestamps()
5
timeout(time: 2, unit: 'HOURS')
6
buildDiscarder(logRotator(numToKeepStr:'5'))
7
disableConcurrentBuilds(abortPrevious: true)
- timestamps()
8
}
9
triggers {
10
cron '@weekly'
@@ -64,12 +65,10 @@ pipeline {
64
65
66
67
def buildAndPushImage(directory, imageId) {
- withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
68
- sh """
69
- pushd ${directory}
70
- docker build --pull -t ${imageId} .
71
- docker push ${imageId}
72
- popd
73
- """
+ dir(directory) {
+ sh "docker build --pull -t ${imageId} ."
+ withDockerRegistry([credentialsId: 'docker.com-bot', url: '']) {
+ sh "docker push ${imageId}"
+ }
74
75
0 commit comments