Skip to content

Commit

Permalink
Merge 10e1caa into e08dbe0
Browse files Browse the repository at this point in the history
  • Loading branch information
Clayton7510 committed Sep 10, 2020
2 parents e08dbe0 + 10e1caa commit fb018bf
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 31 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/cd.yml
@@ -0,0 +1,77 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CD with Maven

on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Maven
env:
GPG_KEY: ${{ secrets.MAVEN_KEY }}
run: |
export GPG_TTY=$(tty)
cp .mvn.settings.xml $HOME/.m2/settings.xml
echo "$GPG_KEY" >> codesigning.asc
gpg --batch --import codesigning.asc
shred --remove codesigning.asc
- name: Set up Terraform
run: |
curl -g https://releases.hashicorp.com/terraform/0.12.9/terraform_0.12.9_linux_amd64.zip -o /tmp/terraform.zip
sudo unzip /tmp/terraform.zip -d /usr/bin
- name: Build with Maven
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
cd tf-build-tools
./mvnw clean test coveralls:report -DrepoToken="$COVERALLS_REPO_TOKEN"
cd ..
- name: Deploy
id: deploy
env:
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PW }}
GPG_KEY_PW: ${{ secrets.MAVEN_KEY_PW }}
GPG_KEY_ID: ${{ secrets.MAVEN_KEY_ID }}
run: |
cd tf-build-tools
VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
PROFILE=""
# if [ "$BRANCH_NAME" == "develop" ] && ![ echo $VERSION | grep -q SNAPSHOT ]; then
if ![ echo $VERSION | grep -q SNAPSHOT ]; then
DOTS=$VERSION | sed -e 's/\(.\)/\n/g' | grep l | wc -l
# Ensure that the build number is in the 4th [semver] position
if [ "$DOTS" < "3" ]; then
VERSION="${VERSION}.0"
fi
VERSION="${VERSION}-${GITHUB_RUN_NUMBER}"
echo "***** VERSION is $VERSION ******"
./mvnw versions:set -DnewVersion="${VERSION}"
else
PROFILE="release"
fi
# Stage for Maven Central Deployment
export GPG_TTY=$(tty)
./mvnw deploy -DskipTests=true -P ${PROFILE}
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,30 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
pull_request:
branches: [ foo ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Terraform
run: |
curl -g https://releases.hashicorp.com/terraform/0.12.9/terraform_0.12.9_linux_amd64.zip -o /tmp/terraform.zip
sudo unzip /tmp/terraform.zip -d /usr/bin
- name: Build with Maven
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
cp .mvn.settings.xml $HOME/.m2/settings.xml
cd tf-build-tools && ./mvnw clean test coveralls:report -DrepoToken="$COVERALLS_REPO_TOKEN"
13 changes: 13 additions & 0 deletions .mvn.settings.xml
Expand Up @@ -9,4 +9,17 @@
<pluginGroups>
<pluginGroup>org.eluder.coveralls</pluginGroup>
</pluginGroups>
<profiles>
<profile>
<id>release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_ID}</gpg.keyname>
<gpg.passphrase>${env.GPG_KEY_PW}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
24 changes: 2 additions & 22 deletions .travis.yml
@@ -1,33 +1,13 @@
language: java
env:
global:
- secure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AyrY6IMmzRsyGmRxhpdoreQwHFKIsydqxEtBXHZ3oCcjR83hxLF9atbefWq8CNfvdLYsUUxwsUSmF+IBo5se/kJ7zwdb9yFWX2NzlJhchDmU97dXIzdn8PI4mFC0p/gmllJvr/cdjSBxLxgPVcH8fQ0kH6oMgNEXKvl1od/Qls95w0nP4W33zYxEk+DCKwdCXIQ8arEj4lamSEGyzii0zdn1gM/LExyu/SQ8ZOeWTEOLHuWYMNj7zuEVmaf1b1wwZf8a5E8hH4W6RA=
sudo: false
branches:
only:
- develop
- /^release\/v.*$/
- /^hotfix\/v.*$/
- none
cache:
directories:
- $HOME/.m2
jdk:
- openjdk8
before_install:
- curl -g https://releases.hashicorp.com/terraform/0.12.9/terraform_0.12.9_linux_amd64.zip -o /tmp/terraform.zip
- sudo unzip /tmp/terraform.zip -d /usr/bin
script:
- |
cd tf-build-tools
echo "*** Downloading the help plugin and getting the project version ***"
./mvnw org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
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
else
echo "*** Validating the build ***"
./mvnw clean test coveralls:report
fi
"***** Travis No More! *****"
6 changes: 3 additions & 3 deletions README.md
@@ -1,10 +1,10 @@
[tf-maven-plugin]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-maven-plugin/0.11/maven-plugin
[tf-cmd-api]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-cmd-api/0.11/jar
[tf-maven-plugin]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-maven-plugin/0.11.1/maven-plugin
[tf-cmd-api]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-cmd-api/0.11.1/jar
[tf-s3-archetype]:https://search.maven.org/artifact/com.deliveredtechnologies/tf-s3-archetype/0.11/jar
[tf-maven-plugin-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-maven-plugin/
[tf-cmd-api-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-cmd-api/
[tf-s3-archetype-snapshot]:https://oss.sonatype.org/content/repositories/snapshots/com/deliveredtechnologies/tf-s3-archetype/
[maven-badge]:https://img.shields.io/badge/maven%20central-0.11-green.svg
[maven-badge]:https://img.shields.io/badge/maven%20central-0.11.1-green.svg
[maven-snapshot-badge]:https://img.shields.io/badge/SNAPSHOT-0.12-green.svg

![terraform-maven](.docs/MavenTerraform.png)
Expand Down
1 change: 0 additions & 1 deletion tf-build-tools/.coveralls.yml

This file was deleted.

8 changes: 7 additions & 1 deletion tf-build-tools/pom.xml
Expand Up @@ -6,7 +6,7 @@
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-build-tools</artifactId>
<packaging>pom</packaging>
<version>0.12-SNAPSHOT</version>
<version>0.12</version>
<description>Terraform Build Tools: The parent POM project for Java and Terraform Tools</description>
<modules>
<module>tf-cmd-api</module>
Expand Down Expand Up @@ -136,6 +136,12 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-cmd-api/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tf-build-tools</artifactId>
<groupId>com.deliveredtechnologies</groupId>
<version>0.12-SNAPSHOT</version>
<version>0.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tf-cmd-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-maven-plugin/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.deliveredtechnologies</groupId>
<artifactId>tf-build-tools</artifactId>
<version>0.12-SNAPSHOT</version>
<version>0.12</version>
</parent>
<artifactId>tf-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-s3-archetype/pom.xml
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.deliveredtechnologies</groupId>
<version>0.12-SNAPSHOT</version>
<version>0.12</version>
<artifactId>tf-build-tools</artifactId>
</parent>
<artifactId>tf-s3-archetype</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tf-build-tools/tf-test/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tf-build-tools</artifactId>
<groupId>com.deliveredtechnologies</groupId>
<version>0.12-SNAPSHOT</version>
<version>0.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit fb018bf

Please sign in to comment.