diff --git a/pom.xml b/pom.xml index b2673b3..ed18522 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 0.5.0-beta1 + 0.5.0-beta.2 azbuilder https://sonarcloud.io true diff --git a/terraform-client/pom.xml b/terraform-client/pom.xml index 3dcf1aa..74d08d4 100644 --- a/terraform-client/pom.xml +++ b/terraform-client/pom.xml @@ -19,7 +19,7 @@ UTF-8 - 0.5.0-beta1 + 0.5.0-beta.2 false 4.9.1 2.8.0 diff --git a/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java b/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java index e2acb81..7d788dd 100644 --- a/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java +++ b/terraform-client/src/main/java/org/azbuilder/terraform/TerraformClient.java @@ -65,12 +65,12 @@ public CompletableFuture show(@NonNull String terraformVersion, @NonNul new HashMap(), outputListener, errorListener, - TerraformCommand.init, TerraformCommand.show); + TerraformCommand.show); } public CompletableFuture show() throws IOException { this.checkRunningParameters(); - return this.run(TerraformCommand.init, TerraformCommand.show); + return this.run(TerraformCommand.show); } public CompletableFuture showPlan(@NonNull String terraformVersion, @NonNull File workingDirectory, String terraformBackendConfigFileName, @NonNull Consumer outputListener, @NonNull Consumer errorListener) throws IOException { @@ -82,12 +82,29 @@ public CompletableFuture showPlan(@NonNull String terraformVersion, @No new HashMap(), outputListener, errorListener, - TerraformCommand.init, TerraformCommand.showPlan); + TerraformCommand.showPlan); } public CompletableFuture showPlan() throws IOException { this.checkRunningParameters(); - return this.run(TerraformCommand.init, TerraformCommand.showPlan); + return this.run(TerraformCommand.showPlan); + } + + public CompletableFuture init(@NonNull String terraformVersion, @NonNull File workingDirectory, String terraformBackendConfigFileName, @NonNull Consumer outputListener, @NonNull Consumer errorListener) throws IOException { + return this.run( + terraformVersion, + workingDirectory, + terraformBackendConfigFileName, + new HashMap<>(), + new HashMap<>(), + outputListener, + errorListener, + TerraformCommand.init); + } + + public CompletableFuture init() throws IOException { + this.checkRunningParameters(); + return this.run(TerraformCommand.init); } public CompletableFuture plan(@NonNull String terraformVersion, @NonNull File workingDirectory, String terraformBackendConfigFileName, @NonNull Map terraformVariables, @NonNull Map terraformEnvironmentVariables, @NonNull Consumer outputListener, @NonNull Consumer errorListener) throws IOException { @@ -99,12 +116,12 @@ public CompletableFuture plan(@NonNull String terraformVersion, @NonNul terraformEnvironmentVariables, outputListener, errorListener, - TerraformCommand.init, TerraformCommand.plan); + TerraformCommand.plan); } public CompletableFuture plan() throws IOException { this.checkRunningParameters(); - return this.run(TerraformCommand.init, TerraformCommand.plan); + return this.run(TerraformCommand.plan); } public CompletableFuture apply(@NonNull String terraformVersion, @NonNull File workingDirectory, String terraformBackendConfigFileName, @NonNull Map terraformVariables, @NonNull Map terraformEnvironmentVariables, @NonNull Consumer outputListener, @NonNull Consumer errorListener) throws IOException { @@ -116,12 +133,12 @@ public CompletableFuture apply(@NonNull String terraformVersion, @NonNu terraformEnvironmentVariables, outputListener, errorListener, - TerraformCommand.init, TerraformCommand.apply); + TerraformCommand.apply); } public CompletableFuture apply() throws IOException { this.checkRunningParameters(); - return this.run(TerraformCommand.init, TerraformCommand.apply); + return this.run(TerraformCommand.apply); } public CompletableFuture destroy(@NonNull String terraformVersion, @NonNull File workingDirectory, String terraformBackendConfigFileName, @NonNull Map terraformEnvironmentVariables, @NonNull Consumer outputListener, @NonNull Consumer errorListener) throws IOException { @@ -133,12 +150,12 @@ public CompletableFuture destroy(@NonNull String terraformVersion, @Non terraformEnvironmentVariables, outputListener, errorListener, - TerraformCommand.init, TerraformCommand.destroy); + TerraformCommand.destroy); } public CompletableFuture destroy() throws IOException { this.checkRunningParameters(); - return this.run(TerraformCommand.init, TerraformCommand.destroy); + return this.run(TerraformCommand.destroy); } private CompletableFuture run(String terraformVersion, File workingDirectory, String terraformBackendConfigFileName, Map terraformVariables, Map terraformEnvironmentVariables, Consumer outputListener, Consumer errorListener, TerraformCommand... commands) throws IOException { diff --git a/terraform-spring-boot-autoconfigure/pom.xml b/terraform-spring-boot-autoconfigure/pom.xml index 8281b03..bc67fe3 100644 --- a/terraform-spring-boot-autoconfigure/pom.xml +++ b/terraform-spring-boot-autoconfigure/pom.xml @@ -18,7 +18,7 @@ UTF-8 - 0.5.0-beta1 + 0.5.0-beta.2 false 1.18.20 diff --git a/terraform-spring-boot-samples/pom.xml b/terraform-spring-boot-samples/pom.xml index bd433c9..9667003 100644 --- a/terraform-spring-boot-samples/pom.xml +++ b/terraform-spring-boot-samples/pom.xml @@ -18,7 +18,7 @@ UTF-8 - 0.5.0-beta1 + 0.5.0-beta.2 true diff --git a/terraform-spring-boot-samples/raw-client-library-sample/src/main/java/org/azbuilder/samples/RawClientLibSampleApp.java b/terraform-spring-boot-samples/raw-client-library-sample/src/main/java/org/azbuilder/samples/RawClientLibSampleApp.java index 9a86182..f8ea811 100644 --- a/terraform-spring-boot-samples/raw-client-library-sample/src/main/java/org/azbuilder/samples/RawClientLibSampleApp.java +++ b/terraform-spring-boot-samples/raw-client-library-sample/src/main/java/org/azbuilder/samples/RawClientLibSampleApp.java @@ -37,6 +37,8 @@ public static void main(String[] args) throws Exception { try (TerraformClient client = TerraformClient.builder().terraformParameters(terraformParameters).environmentVariables(environmentVariables).build()) { + client.init(); + System.out.println(client.version().get()); client.setOutputListener(System.out::println); client.setErrorListener(System.err::println); diff --git a/terraform-spring-boot-starter/pom.xml b/terraform-spring-boot-starter/pom.xml index 91ab10a..1cc5b5c 100644 --- a/terraform-spring-boot-starter/pom.xml +++ b/terraform-spring-boot-starter/pom.xml @@ -13,7 +13,7 @@ UTF-8 - 0.5.0-beta1 + 0.5.0-beta.2 false