Build images during preview by default
This commit is contained in:
@@ -40,7 +40,7 @@ import (
|
||||
"github.com/pulumi/pulumi-go-provider/infer"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/common/util/ciutil"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -127,21 +127,19 @@ func (ia *ImageArgs) Annotate(a infer.Annotator) {
|
||||
Equivalent to Docker's "--build-arg" flag.
|
||||
`))
|
||||
a.Describe(&ia.BuildOnPreview, dedent(`
|
||||
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.
|
||||
|
||||
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.
|
||||
`))
|
||||
a.SetDefault(&ia.BuildOnPreview, pulumi.Bool(true))
|
||||
a.Describe(&ia.Builder, dedent(`
|
||||
Builder configuration.
|
||||
`))
|
||||
@@ -457,13 +455,12 @@ func (ia *ImageArgs) isExported() bool {
|
||||
}
|
||||
|
||||
// shouldBuildOnPreview returns true if we should build this image during
|
||||
// previews. In CI environments we default to building during previews, but we
|
||||
// always respect buildOnPreview if it was specified.
|
||||
// previews.
|
||||
func (ia *ImageArgs) shouldBuildOnPreview() bool {
|
||||
if ia.BuildOnPreview != nil {
|
||||
return *ia.BuildOnPreview
|
||||
}
|
||||
return ciutil.IsCI()
|
||||
return true
|
||||
}
|
||||
|
||||
type build struct {
|
||||
|
||||
27
sdk/dotnet/Image.cs
generated
27
sdk/dotnet/Image.cs
generated
@@ -511,20 +511,17 @@ namespace Pulumi.DockerBuild
|
||||
public Output<ImmutableDictionary<string, string>?> BuildArgs { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[Output("buildOnPreview")]
|
||||
public Output<bool?> BuildOnPreview { get; private set; } = null!;
|
||||
@@ -842,20 +839,17 @@ namespace Pulumi.DockerBuild
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[Input("buildOnPreview")]
|
||||
public Input<bool>? BuildOnPreview { get; set; }
|
||||
@@ -1110,6 +1104,7 @@ namespace Pulumi.DockerBuild
|
||||
|
||||
public ImageArgs()
|
||||
{
|
||||
BuildOnPreview = true;
|
||||
Network = Pulumi.DockerBuild.NetworkMode.@Default;
|
||||
}
|
||||
public static new ImageArgs Empty => new ImageArgs();
|
||||
|
||||
55
sdk/go/dockerbuild/image.go
generated
55
sdk/go/dockerbuild/image.go
generated
@@ -551,20 +551,17 @@ type Image struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs pulumi.StringMapOutput `pulumi:"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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview pulumi.BoolPtrOutput `pulumi:"buildOnPreview"`
|
||||
// Builder configuration.
|
||||
Builder BuilderConfigPtrOutput `pulumi:"builder"`
|
||||
@@ -720,6 +717,9 @@ func NewImage(ctx *pulumi.Context,
|
||||
args = &ImageArgs{}
|
||||
}
|
||||
|
||||
if args.BuildOnPreview == nil {
|
||||
args.BuildOnPreview = pulumi.BoolPtr(true)
|
||||
}
|
||||
if args.Network == nil {
|
||||
args.Network = NetworkMode("default")
|
||||
}
|
||||
@@ -770,20 +770,17 @@ type imageArgs struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs map[string]string `pulumi:"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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview *bool `pulumi:"buildOnPreview"`
|
||||
// Builder configuration.
|
||||
Builder *BuilderConfig `pulumi:"builder"`
|
||||
@@ -921,20 +918,17 @@ type ImageArgs struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs pulumi.StringMapInput
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview pulumi.BoolPtrInput
|
||||
// Builder configuration.
|
||||
Builder BuilderConfigPtrInput
|
||||
@@ -1125,20 +1119,17 @@ func (o ImageOutput) BuildArgs() pulumi.StringMapOutput {
|
||||
return o.ApplyT(func(v *Image) pulumi.StringMapOutput { return v.BuildArgs }).(pulumi.StringMapOutput)
|
||||
}
|
||||
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
func (o ImageOutput) BuildOnPreview() pulumi.BoolPtrOutput {
|
||||
return o.ApplyT(func(v *Image) pulumi.BoolPtrOutput { return v.BuildOnPreview }).(pulumi.BoolPtrOutput)
|
||||
}
|
||||
|
||||
55
sdk/go/dockerbuild/x/image.go
generated
55
sdk/go/dockerbuild/x/image.go
generated
@@ -551,20 +551,17 @@ type Image struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs pulumix.MapOutput[string] `pulumi:"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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview pulumix.Output[*bool] `pulumi:"buildOnPreview"`
|
||||
// Builder configuration.
|
||||
Builder pulumix.GPtrOutput[BuilderConfig, BuilderConfigOutput] `pulumi:"builder"`
|
||||
@@ -720,6 +717,9 @@ func NewImage(ctx *pulumi.Context,
|
||||
args = &ImageArgs{}
|
||||
}
|
||||
|
||||
if args.BuildOnPreview == nil {
|
||||
args.BuildOnPreview = pulumix.Ptr(true)
|
||||
}
|
||||
if args.Network == nil {
|
||||
args.Network = pulumix.Ptr(NetworkMode("default"))
|
||||
}
|
||||
@@ -770,20 +770,17 @@ type imageArgs struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs map[string]string `pulumi:"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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview *bool `pulumi:"buildOnPreview"`
|
||||
// Builder configuration.
|
||||
Builder *BuilderConfig `pulumi:"builder"`
|
||||
@@ -921,20 +918,17 @@ type ImageArgs struct {
|
||||
//
|
||||
// Equivalent to Docker's `--build-arg` flag.
|
||||
BuildArgs pulumix.Input[map[string]string]
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
BuildOnPreview pulumix.Input[*bool]
|
||||
// Builder configuration.
|
||||
Builder pulumix.Input[*BuilderConfigArgs]
|
||||
@@ -1104,20 +1098,17 @@ func (o ImageOutput) BuildArgs() pulumix.MapOutput[string] {
|
||||
return pulumix.MapOutput[string]{OutputState: unwrapped.OutputState}
|
||||
}
|
||||
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
func (o ImageOutput) BuildOnPreview() pulumix.Output[*bool] {
|
||||
value := pulumix.Apply[Image](o, func(v Image) pulumix.Output[*bool] { return v.BuildOnPreview })
|
||||
return pulumix.Flatten[*bool, pulumix.Output[*bool]](value)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 $;
|
||||
}
|
||||
|
||||
28
sdk/nodejs/image.ts
generated
28
sdk/nodejs/image.ts
generated
@@ -503,20 +503,17 @@ export class Image extends pulumi.CustomResource {
|
||||
*/
|
||||
public readonly buildArgs!: pulumi.Output<{[key: string]: string} | undefined>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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 readonly buildOnPreview!: pulumi.Output<boolean | undefined>;
|
||||
/**
|
||||
@@ -722,7 +719,7 @@ export class Image extends pulumi.CustomResource {
|
||||
if (!opts.id) {
|
||||
resourceInputs["addHosts"] = args ? args.addHosts : undefined;
|
||||
resourceInputs["buildArgs"] = args ? args.buildArgs : undefined;
|
||||
resourceInputs["buildOnPreview"] = args ? args.buildOnPreview : undefined;
|
||||
resourceInputs["buildOnPreview"] = (args ? args.buildOnPreview : undefined) ?? true;
|
||||
resourceInputs["builder"] = args ? args.builder : undefined;
|
||||
resourceInputs["cacheFrom"] = args ? args.cacheFrom : undefined;
|
||||
resourceInputs["cacheTo"] = args ? args.cacheTo : undefined;
|
||||
@@ -800,20 +797,17 @@ export interface ImageArgs {
|
||||
*/
|
||||
buildArgs?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
buildOnPreview?: pulumi.Input<boolean>;
|
||||
/**
|
||||
|
||||
56
sdk/python/pulumi_docker_build/image.py
generated
56
sdk/python/pulumi_docker_build/image.py
generated
@@ -53,20 +53,17 @@ class ImageArgs:
|
||||
if these arguments are sensitive.
|
||||
|
||||
Equivalent to Docker's `--build-arg` flag.
|
||||
:param pulumi.Input[bool] build_on_preview: 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 pulumi.Input[bool] build_on_preview: 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.
|
||||
|
||||
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.
|
||||
:param pulumi.Input['BuilderConfigArgs'] builder: Builder configuration.
|
||||
:param pulumi.Input[Sequence[pulumi.Input['CacheFromArgs']]] cache_from: Cache export configuration.
|
||||
|
||||
@@ -171,6 +168,8 @@ class ImageArgs:
|
||||
pulumi.set(__self__, "add_hosts", add_hosts)
|
||||
if build_args is not None:
|
||||
pulumi.set(__self__, "build_args", build_args)
|
||||
if build_on_preview is None:
|
||||
build_on_preview = True
|
||||
if build_on_preview is not None:
|
||||
pulumi.set(__self__, "build_on_preview", build_on_preview)
|
||||
if builder is not None:
|
||||
@@ -252,20 +251,17 @@ class ImageArgs:
|
||||
@pulumi.getter(name="buildOnPreview")
|
||||
def build_on_preview(self) -> Optional[pulumi.Input[bool]]:
|
||||
"""
|
||||
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.
|
||||
|
||||
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 pulumi.get(self, "build_on_preview")
|
||||
|
||||
@@ -921,20 +917,17 @@ class Image(pulumi.CustomResource):
|
||||
if these arguments are sensitive.
|
||||
|
||||
Equivalent to Docker's `--build-arg` flag.
|
||||
:param pulumi.Input[bool] build_on_preview: 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 pulumi.Input[bool] build_on_preview: 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.
|
||||
|
||||
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.
|
||||
:param pulumi.Input[pulumi.InputType['BuilderConfigArgs']] builder: Builder configuration.
|
||||
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['CacheFromArgs']]]] cache_from: Cache export configuration.
|
||||
|
||||
@@ -1386,6 +1379,8 @@ class Image(pulumi.CustomResource):
|
||||
|
||||
__props__.__dict__["add_hosts"] = add_hosts
|
||||
__props__.__dict__["build_args"] = build_args
|
||||
if build_on_preview is None:
|
||||
build_on_preview = True
|
||||
__props__.__dict__["build_on_preview"] = build_on_preview
|
||||
__props__.__dict__["builder"] = builder
|
||||
__props__.__dict__["cache_from"] = cache_from
|
||||
@@ -1490,20 +1485,17 @@ class Image(pulumi.CustomResource):
|
||||
@pulumi.getter(name="buildOnPreview")
|
||||
def build_on_preview(self) -> pulumi.Output[Optional[bool]]:
|
||||
"""
|
||||
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.
|
||||
|
||||
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 pulumi.get(self, "build_on_preview")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user