Skip to content

Commit

Permalink
Merge branch 'master' into release/v0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Clayton7510 committed Jul 13, 2020
2 parents 92b80e4 + 7cfc6a0 commit 110405d
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 6 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -27,6 +27,8 @@ script:
if [ $TRAVIS_PULL_REQUEST = "false" ] && echo $VERSION | grep -q SNAPSHOT; then
echo "*** Validating the build and deploying to Sonatype's SNAPSHOT repo ***"
cp ../.mvn.settings.xml $HOME/.m2/settings.xml && ./mvnw clean test coveralls:report deploy
echo "*** Deploying the tf-s3-archetype to Sonatype's SNAPSHOT repo ***"
cd ../tf-s3-archetype && ./mvnw clean deploy
else
echo "*** Validating the build ***"
./mvnw clean test coveralls:report
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -38,6 +38,7 @@ The Terraform Maven Plugin brings Maven to Terraform, which greatly enhances Ter
* [tf:deploy](#tfdeploy)
* [tf:clean](#tfclean)
* [tf:wrapper](#tfwrapper)

* [How Commands Are Delegated to Terraform](#how-commands-are-delegated-to-terraform)
* [*nix-based Operating Systems](#nix-based-operating-systems)
* [Windows Operating Systems](#windows-operating-systems)
Expand Down Expand Up @@ -257,6 +258,8 @@ Deletes all 'terraform' files from terraform configurations along with the Terra
| tfRootDir | String | The terraform root module directory location; defaults to src/main/tf/{first directory found} |
| tfModulesDir | String | The directory that contains the Terraform module depenencies; defaults to src/main/.tfmodules |

---

#### tf:wrapper

Description:
Expand Down
66 changes: 66 additions & 0 deletions examples/tf-s3-consumer/pom.xml
Expand Up @@ -144,6 +144,72 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- disables default jar packaging: https://stackoverflow.com/questions/2188746/what-is-the-best-way-to-avoid-maven-jar -->
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>never</phase>
<configuration>
<finalName>unwanted</finalName>
<classifier>unwanted</classifier>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-maven-plugin</artifactId>
<version>${tf-maven-version}</version>
<executions>
<execution>
<id>terraform-clean</id>
<phase>clean</phase>
<goals>
<goal>init</goal>
<goal>destroy</goal>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>terraform-plan</id>
<phase>verify</phase>
<goals>
<goal>init</goal>
<goal>plan</goal>
</goals>
</execution>
<execution>
<id>terraform-pacakge</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
<execution>
<id>terraform-install</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>terraform-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>terraform-get</id>
<phase>validate</phase>
<goals>
<goal>get</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
51 changes: 49 additions & 2 deletions examples/tf-s3/pom.xml
Expand Up @@ -48,8 +48,6 @@
<version>1.7.30</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
Expand Down Expand Up @@ -118,6 +116,55 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- disables default jar packaging: https://stackoverflow.com/questions/2188746/what-is-the-best-way-to-avoid-maven-jar -->
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>never</phase>
<configuration>
<finalName>unwanted</finalName>
<classifier>unwanted</classifier>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-maven-plugin</artifactId>
<version>${tf-maven-version}</version>
<executions>
<execution>
<id>terraform-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>terraform-install</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>terraform-package</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
<execution>
<id>terraform-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
Expand Up @@ -115,4 +115,8 @@ public void setLogger(Logger logger) {
public Path getDirectory() {
return this.directory;
}

private void addShutdownHook(Process process) {
Runtime.getRuntime().addShutdownHook(new Thread(() -> process.destroyForcibly()));
}
}
Expand Up @@ -26,7 +26,6 @@ public class TerraformCommandLineDecorator implements Executable {
public TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine, Logger logger) {
this.commandLine = commandLine;
this.cmd = cmd;

this.logger = Optional.ofNullable(logger);
this.logger.ifPresent(log -> this.commandLine.setLogger(log));
}
Expand Down
Expand Up @@ -50,8 +50,6 @@ public void terraformApplyExecutesWhenAllPossiblePropertiesArePassed() throws IO
.thenReturn("Success!");
TerraformApply terraformApply = new TerraformApply(terraformDecorator);



this.properties.put(TerraformApplyParam.tfVarFiles.property, "test1.txt, test2.txt");
this.properties.put(TerraformApplyParam.tfVars.property, "key1=value1, key2=value2");
this.properties.put(TerraformApplyParam.lockTimeout.property, "1000");
Expand Down
Expand Up @@ -3,6 +3,7 @@
import com.deliveredtechnologies.maven.terraform.TerraformGetMavenRootArtifact;
import com.deliveredtechnologies.terraform.TerraformException;
import com.deliveredtechnologies.terraform.api.TerraformInit;

import org.apache.commons.lang3.StringUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
Expand Down Expand Up @@ -49,7 +50,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
TerraformGetMavenRootArtifact mavenRepoExecutableOp = new TerraformGetMavenRootArtifact(artifact, tfRootDir, getLog());
tfRootDir = mavenRepoExecutableOp.execute(getFieldsAsProperties());
}

execute(new TerraformInit(tfRootDir), getFieldsAsProperties());
} catch (IOException | TerraformException e) {
throw new MojoExecutionException(e.getMessage(), e);
Expand Down
1 change: 1 addition & 0 deletions tf-build-tools/tf-maven-plugin/src/main/resources/tf/tfw
Expand Up @@ -64,6 +64,7 @@ releaseSourceLinux="${distributionSite}/${releaseDir}/${releaseVer}/${releaseNam
releaseSourceWindows="${distributionSite}/${releaseDir}/${releaseVer}/${releaseName}_${releaseVer}_${releaseWindows}_${releaseSuffix}"

releaseOS=Linux

if [[ $releaseOS == "windows" ]]
then
terraformBinary=$terraformBinaryWindows
Expand Down

0 comments on commit 110405d

Please sign in to comment.