Housekeeping (#8)

* Rename the provider to dockerbuild.
* Add Makefile targets required by CI.
* Add per-language test targets compatible with CI.
* Fix broken example yaml.
* Add gitignore exclusions to fix SDK generation in CI.
* Fix lint errors.
* Vendor pulumi CLI via `tools.go` instead of `.pulumi`.
* Consolidate `go.mod`s into one file, with a minimal `go.mod` for the
Go SDK.
* Add codecov.
This commit is contained in:
Bryce Lampe
2024-03-20 11:09:37 -07:00
committed by GitHub
parent 3eb77f66f2
commit 2b348f84e4
81 changed files with 1418 additions and 3251 deletions

View File

@@ -0,0 +1,47 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.dockerbuild;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.dockerbuild.ProviderArgs;
import com.pulumi.dockerbuild.Utilities;
import javax.annotation.Nullable;
@ResourceType(type="pulumi:providers:dockerbuild")
public class Provider extends com.pulumi.resources.ProviderResource {
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Provider(String name) {
this(name, ProviderArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Provider(String name, @Nullable ProviderArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Provider(String name, @Nullable ProviderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("dockerbuild", name, args == null ? ProviderArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
}

View File

@@ -0,0 +1,28 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.dockerbuild;
public final class ProviderArgs extends com.pulumi.resources.ResourceArgs {
public static final ProviderArgs Empty = new ProviderArgs();
public static Builder builder() {
return new Builder();
}
public static final class Builder {
private ProviderArgs $;
public Builder() {
$ = new ProviderArgs();
}
public ProviderArgs build() {
return $;
}
}
}

View File

@@ -0,0 +1,78 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.dockerbuild;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.dockerbuild.RandomArgs;
import com.pulumi.dockerbuild.Utilities;
import java.lang.Integer;
import java.lang.String;
import javax.annotation.Nullable;
@ResourceType(type="dockerbuild:index:Random")
public class Random extends com.pulumi.resources.CustomResource {
@Export(name="length", refs={Integer.class}, tree="[0]")
private Output<Integer> length;
public Output<Integer> length() {
return this.length;
}
@Export(name="result", refs={String.class}, tree="[0]")
private Output<String> result;
public Output<String> result() {
return this.result;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Random(String name) {
this(name, RandomArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Random(String name, RandomArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Random(String name, RandomArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("dockerbuild:index:Random", name, args == null ? RandomArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
}
private Random(String name, Output<String> id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("dockerbuild:index:Random", name, null, makeResourceOptions(options, id));
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Random get(String name, Output<String> id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Random(name, id, options);
}
}

View File

@@ -0,0 +1,65 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.dockerbuild;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.util.Objects;
public final class RandomArgs extends com.pulumi.resources.ResourceArgs {
public static final RandomArgs Empty = new RandomArgs();
@Import(name="length", required=true)
private Output<Integer> length;
public Output<Integer> length() {
return this.length;
}
private RandomArgs() {}
private RandomArgs(RandomArgs $) {
this.length = $.length;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(RandomArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private RandomArgs $;
public Builder() {
$ = new RandomArgs();
}
public Builder(RandomArgs defaults) {
$ = new RandomArgs(Objects.requireNonNull(defaults));
}
public Builder length(Output<Integer> length) {
$.length = length;
return this;
}
public Builder length(Integer length) {
return length(Output.of(length));
}
public RandomArgs build() {
if ($.length == null) {
throw new MissingRequiredPropertyException("RandomArgs", "length");
}
return $;
}
}
}

View File

@@ -0,0 +1,89 @@
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.dockerbuild;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import com.pulumi.core.internal.Environment;
import com.pulumi.deployment.InvokeOptions;
public class Utilities {
public static Optional<String> getEnv(String... names) {
for (var n : names) {
var value = Environment.getEnvironmentVariable(n);
if (value.isValue()) {
return Optional.of(value.value());
}
}
return Optional.empty();
}
public static Optional<Boolean> getEnvBoolean(String... names) {
for (var n : names) {
var value = Environment.getBooleanEnvironmentVariable(n);
if (value.isValue()) {
return Optional.of(value.value());
}
}
return Optional.empty();
}
public static Optional<Integer> getEnvInteger(String... names) {
for (var n : names) {
var value = Environment.getIntegerEnvironmentVariable(n);
if (value.isValue()) {
return Optional.of(value.value());
}
}
return Optional.empty();
}
public static Optional<Double> getEnvDouble(String... names) {
for (var n : names) {
var value = Environment.getDoubleEnvironmentVariable(n);
if (value.isValue()) {
return Optional.of(value.value());
}
}
return Optional.empty();
}
public static InvokeOptions withVersion(@Nullable InvokeOptions options) {
if (options != null && options.getVersion().isPresent()) {
return options;
}
return new InvokeOptions(
options == null ? null : options.getParent().orElse(null),
options == null ? null : options.getProvider().orElse(null),
getVersion()
);
}
private static final String version;
public static String getVersion() {
return version;
}
static {
var resourceName = "com/pulumi/dockerbuild/version.txt";
var versionFile = Utilities.class.getClassLoader().getResourceAsStream(resourceName);
if (versionFile == null) {
throw new IllegalStateException(
String.format("expected resource '%s' on Classpath, not found", resourceName)
);
}
version = new BufferedReader(new InputStreamReader(versionFile))
.lines()
.collect(Collectors.joining("\n"))
.trim();
}
}