Skip to content
Permalink
Browse files
[FIXED JENKINS-25835] Allow no-cache option in Create Image step
  • Loading branch information
vjuranek committed Dec 3, 2014
1 parent 30c3c6f commit 592ac8758fefabfe4e53cd562d54b07813567779
Showing 2 changed files with 12 additions and 2 deletions.
@@ -39,11 +39,13 @@ public class CreateImageCommand extends DockerCommand {

private final String dockerFolder;
private final String imageTag;
private final boolean noCache;

@DataBoundConstructor
public CreateImageCommand(String dockerFolder, String imageTag) {
public CreateImageCommand(String dockerFolder, String imageTag, boolean noCache) {
this.dockerFolder = dockerFolder;
this.imageTag = imageTag;
this.noCache = noCache;
}

public String getDockerFolder() {
@@ -53,6 +55,10 @@ public String getDockerFolder() {
public String getImageTag() {
return imageTag;
}

public boolean isNoCache() {
return noCache;
}

@Override
public void execute(@SuppressWarnings("rawtypes") AbstractBuild build,
@@ -95,7 +101,7 @@ public void execute(@SuppressWarnings("rawtypes") AbstractBuild build,

console.logInfo("Creating docker image from " + docker.getAbsolutePath());

InputStream istream = client.buildImageCmd(docker).withTag(expandedImageTag).exec();
InputStream istream = client.buildImageCmd(docker).withTag(expandedImageTag).withNoCache(noCache).exec();

final List<JsonObject> errors = new ArrayList<JsonObject>();

@@ -9,5 +9,9 @@
<f:textbox default="$BUILD_NUMBER"/>
</f:entry>

<f:entry field="noCache" title="Don't use the cache when building the image">
<f:checkbox />
</f:entry>


</j:jelly>

0 comments on commit 592ac87

Please sign in to comment.