Skip to content

Commit

Permalink
Sign artifacts and deploy to sonatype staging
Browse files Browse the repository at this point in the history
Add an encrypted GnuPG keyring and use it for signing the artifacts.
When a Tag is present deploy to sonatype staging repository.
  • Loading branch information
joshiste committed Nov 15, 2015
1 parent 8e86ed0 commit 6289d88
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ target/
.idea/
*.iml
*.iws

# gnupg keyring
/.gnupg
Binary file added .gnupg.tar.enc
Binary file not shown.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ language: java
sudo: false

before_install:
- openssl aes-256-cbc -d -pass "env:DECRYPT_KEYPHRASE" -in .gnupg.tar.enc | tar xv
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "[[ ${TRAVIS_TAG} != '' ]] && mvn versions:set -DnewVersion='${TRAVIS_TAG}'"

script: mvn clean verify

after_success:
- mvn jacoco:report coveralls:report
- "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} == '' ]] && mvn deploy -DreposityId=sonatype-nexus-snapshots -DskipTests --settings deploy-settings.xml"
- "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} != '' ]] && mvn deploy -DreposityId=sonatype-nexus-staging -DskipTests --settings deploy-settings.xml"
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,23 +177,13 @@ You can access snapshot builds from the sonatype repository:


#### Build
In order to build spring-boot-admin you need to have node.js and npm on your PATH.
In order to build spring-boot-admin you need to have node.js and npm on your `PATH`.

```shell
mvn clean package
```

#### Release

```shell
mvn build-helper:parse-version versions:set -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
mvn -Psign-artifacts clean deploy
```

#### Increment version for next release

Example:

#### Set version for next release
```shell
mvn build-helper:parse-version versions:set versions:commit -DnewVersion=1.0.0-SNAPSHOT
```
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<properties>
<java.version>1.7</java.version>
<main.basedir>${basedir}</main.basedir>
<passphrase>${gpg.passphrase}</passphrase>
<spring-boot.version>1.3.0.RC1</spring-boot.version>
<spring-cloud.version>Brixton.M2</spring-cloud.version>
<build-plugin.jacoco.version>0.7.5.201505241946</build-plugin.jacoco.version>
Expand Down Expand Up @@ -102,15 +101,18 @@
<profile>
<id>sign-artifacts</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env.GPG_PASSPHRASE</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<passphrase>${passphrase}</passphrase>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<homedir>${user.dir}/.gnupg</homedir>
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit 6289d88

Please sign in to comment.