Skip to content

Commit

Permalink
CI: build docker image once on changes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
  • Loading branch information
lebdron committed Aug 23, 2019
1 parent c2e97c7 commit ab3d668
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .jenkinsci/utils/docker-pull-or-build.groovy
Expand Up @@ -34,9 +34,10 @@ def dockerPullOrBuild(imageName, currentDockerfileURL, referenceDockerfileURL, s
// because Dockerfile may contain apt-get entries that would try to update
// from invalid (stale) addresses
iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} --no-cache -f ${currentDockerfile} .")
} else {
// Build using cache
iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} --cache-from ${env.DOCKER_REGISTRY_BASENAME}:${imageName} -f ${currentDockerfile} .")
}
// Build using cache
iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} --cache-from ${env.DOCKER_REGISTRY_BASENAME}:${imageName} -f ${currentDockerfile} .")
}
return iC
}
Expand Down

0 comments on commit ab3d668

Please sign in to comment.