Skip to content

Commit

Permalink
Only do checkout for dockerfile if Dockerfile isn't present
Browse files Browse the repository at this point in the history
While I'm here...realized this would be problematic in a reused-node
situation where the SCM is already checked out.
  • Loading branch information
abayer committed Jan 12, 2017
1 parent a262c3e commit ab5e7cb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public class DockerPipelineFromDockerfileScript extends DeclarativeAgentScript<D

private Closure buildImage() {
return {
script.checkout script.scm
if (!script.fileExists(describable.getDockerfileAsString())) {
script.checkout script.scm
}
try {
def hash = Utils.stringToSHA1(script.readFile(describable.getDockerfileAsString()))
def imgName = "${hash}"
Expand Down

0 comments on commit ab5e7cb

Please sign in to comment.