|
|
|
@ -77,6 +77,8 @@ public class BuildRequest {
|
|
|
|
|
|
|
|
|
|
private final List<ImageReference> tags;
|
|
|
|
|
|
|
|
|
|
private final Cache buildWorkspace;
|
|
|
|
|
|
|
|
|
|
private final Cache buildCache;
|
|
|
|
|
|
|
|
|
|
private final Cache launchCache;
|
|
|
|
@ -102,6 +104,7 @@ public class BuildRequest {
|
|
|
|
|
this.bindings = Collections.emptyList();
|
|
|
|
|
this.network = null;
|
|
|
|
|
this.tags = Collections.emptyList();
|
|
|
|
|
this.buildWorkspace = null;
|
|
|
|
|
this.buildCache = null;
|
|
|
|
|
this.launchCache = null;
|
|
|
|
|
this.createdDate = null;
|
|
|
|
@ -111,8 +114,8 @@ public class BuildRequest {
|
|
|
|
|
BuildRequest(ImageReference name, Function<Owner, TarArchive> applicationContent, ImageReference builder,
|
|
|
|
|
ImageReference runImage, Creator creator, Map<String, String> env, boolean cleanCache,
|
|
|
|
|
boolean verboseLogging, PullPolicy pullPolicy, boolean publish, List<BuildpackReference> buildpacks,
|
|
|
|
|
List<Binding> bindings, String network, List<ImageReference> tags, Cache buildCache, Cache launchCache,
|
|
|
|
|
Instant createdDate, String applicationDirectory) {
|
|
|
|
|
List<Binding> bindings, String network, List<ImageReference> tags, Cache buildWorkspace, Cache buildCache,
|
|
|
|
|
Cache launchCache, Instant createdDate, String applicationDirectory) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.applicationContent = applicationContent;
|
|
|
|
|
this.builder = builder;
|
|
|
|
@ -127,6 +130,7 @@ public class BuildRequest {
|
|
|
|
|
this.bindings = bindings;
|
|
|
|
|
this.network = network;
|
|
|
|
|
this.tags = tags;
|
|
|
|
|
this.buildWorkspace = buildWorkspace;
|
|
|
|
|
this.buildCache = buildCache;
|
|
|
|
|
this.launchCache = launchCache;
|
|
|
|
|
this.createdDate = createdDate;
|
|
|
|
@ -142,8 +146,8 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(builder, "Builder must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, builder.inTaggedOrDigestForm(), this.runImage,
|
|
|
|
|
this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish,
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildCache, this.launchCache,
|
|
|
|
|
this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache,
|
|
|
|
|
this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -154,8 +158,8 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withRunImage(ImageReference runImageName) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, runImageName.inTaggedOrDigestForm(),
|
|
|
|
|
this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish,
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildCache, this.launchCache,
|
|
|
|
|
this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache,
|
|
|
|
|
this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -167,7 +171,7 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(creator, "Creator must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -184,8 +188,8 @@ public class BuildRequest {
|
|
|
|
|
env.put(name, value);
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator,
|
|
|
|
|
Collections.unmodifiableMap(env), this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish,
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildCache, this.launchCache,
|
|
|
|
|
this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache,
|
|
|
|
|
this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -199,8 +203,8 @@ public class BuildRequest {
|
|
|
|
|
updatedEnv.putAll(env);
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator,
|
|
|
|
|
Collections.unmodifiableMap(updatedEnv), this.cleanCache, this.verboseLogging, this.pullPolicy,
|
|
|
|
|
this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildCache,
|
|
|
|
|
this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace,
|
|
|
|
|
this.buildCache, this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -211,7 +215,7 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withCleanCache(boolean cleanCache) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -223,7 +227,7 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withVerboseLogging(boolean verboseLogging) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -235,7 +239,7 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withPullPolicy(PullPolicy pullPolicy) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -247,7 +251,7 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withPublish(boolean publish) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -272,7 +276,7 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(buildpacks, "Buildpacks must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -297,7 +301,7 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(bindings, "Bindings must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -310,7 +314,8 @@ public class BuildRequest {
|
|
|
|
|
public BuildRequest withNetwork(String network) {
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
network, this.tags, this.buildCache, this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -332,7 +337,21 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(tags, "Tags must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, tags, this.buildCache, this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.network, tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a new {@link BuildRequest} with an updated build workspace.
|
|
|
|
|
* @param buildWorkspace the build workspace
|
|
|
|
|
* @return an updated build request
|
|
|
|
|
*/
|
|
|
|
|
public BuildRequest withBuildWorkspace(Cache buildWorkspace) {
|
|
|
|
|
Assert.notNull(buildWorkspace, "BuildWorkspace must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -344,7 +363,8 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(buildCache, "BuildCache must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, buildCache, this.launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -356,7 +376,8 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(launchCache, "LaunchCache must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, launchCache, this.createdDate, this.applicationDirectory);
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, launchCache, this.createdDate,
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -368,8 +389,8 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(createdDate, "CreatedDate must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, parseCreatedDate(createdDate),
|
|
|
|
|
this.applicationDirectory);
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache,
|
|
|
|
|
parseCreatedDate(createdDate), this.applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Instant parseCreatedDate(String createdDate) {
|
|
|
|
@ -393,7 +414,8 @@ public class BuildRequest {
|
|
|
|
|
Assert.notNull(applicationDirectory, "ApplicationDirectory must not be null");
|
|
|
|
|
return new BuildRequest(this.name, this.applicationContent, this.builder, this.runImage, this.creator, this.env,
|
|
|
|
|
this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings,
|
|
|
|
|
this.network, this.tags, this.buildCache, this.launchCache, this.createdDate, applicationDirectory);
|
|
|
|
|
this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, this.createdDate,
|
|
|
|
|
applicationDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -513,6 +535,10 @@ public class BuildRequest {
|
|
|
|
|
return this.tags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Cache getBuildWorkspace() {
|
|
|
|
|
return this.buildWorkspace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the custom build cache that should be used by the lifecycle.
|
|
|
|
|
* @return the build cache
|
|
|
|
|