Build images during preview by default

This commit is contained in:
Bryce Lampe
2024-04-22 16:04:01 -07:00
parent 72bd40b97c
commit 40a3223b23
8 changed files with 132 additions and 189 deletions

View File

@@ -655,14 +655,8 @@ public class Image extends com.pulumi.resources.CustomResource {
return Codegen.optional(this.buildArgs);
}
/**
* By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -670,19 +664,16 @@ public class Image extends com.pulumi.resources.CustomResource {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
*/
@Export(name="buildOnPreview", refs={Boolean.class}, tree="[0]")
private Output</* @Nullable */ Boolean> buildOnPreview;
/**
* @return By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* @return Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -690,6 +681,9 @@ public class Image extends com.pulumi.resources.CustomResource {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
*/
public Output<Optional<Boolean>> buildOnPreview() {
return Codegen.optional(this.buildOnPreview);

View File

@@ -80,14 +80,8 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
}
/**
* By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -95,19 +89,16 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
*/
@Import(name="buildOnPreview")
private @Nullable Output<Boolean> buildOnPreview;
/**
* @return By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* @return Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -115,6 +106,9 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
*/
public Optional<Output<Boolean>> buildOnPreview() {
return Optional.ofNullable(this.buildOnPreview);
@@ -685,14 +679,8 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
}
/**
* @param buildOnPreview By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* @param buildOnPreview Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -700,6 +688,9 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
* @return builder
*
*/
@@ -709,14 +700,8 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
}
/**
* @param buildOnPreview By default, preview behavior depends on the execution environment. If
* Pulumi detects the operation is running on a CI system (GitHub Actions,
* Travis CI, Azure Pipelines, etc.) then it will build images during
* previews as a safeguard. Otherwise, if not running on CI, previews will
* not build images.
*
* Setting this to `false` forces previews to never perform builds, and
* setting it to `true` will always build the image during previews.
* @param buildOnPreview Setting this to `false` will always skip image builds during previews,
* and setting it to `true` will always build images during previews.
*
* Images built during previews are never exported to registries, however
* cache manifests are still exported.
@@ -724,6 +709,9 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* On-disk Dockerfiles are always validated for syntactic correctness
* regardless of this setting.
*
* Defaults to `true` as a safeguard against broken images merging as part
* of CI pipelines.
*
* @return builder
*
*/
@@ -1388,6 +1376,7 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
}
public ImageArgs build() {
$.buildOnPreview = Codegen.booleanProp("buildOnPreview").output().arg($.buildOnPreview).def(true).getNullable();
$.network = Codegen.objectProp("network", NetworkMode.class).output().arg($.network).def(NetworkMode.Default_).getNullable();
return $;
}