Skip to content

Commit

Permalink
[FIXED JENKINS-25835] Allow no-cache option in Create Image step
Browse files Browse the repository at this point in the history
  • Loading branch information
vjuranek committed Dec 3, 2014
1 parent 30c3c6f commit 592ac87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -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() {
Expand All @@ -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,
Expand Down Expand Up @@ -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>();

Expand Down
Expand Up @@ -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.