Skip to content

Commit 6289d88

Browse files
committed
Sign artifacts and deploy to sonatype staging
Add an encrypted GnuPG keyring and use it for signing the artifacts. When a Tag is present deploy to sonatype staging repository.
1 parent 8e86ed0 commit 6289d88

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ target/
1010
.idea/
1111
*.iml
1212
*.iws
13+
14+
# gnupg keyring
15+
/.gnupg

.gnupg.tar.enc

30 KB
Binary file not shown.

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ language: java
22
sudo: false
33

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

810
script: mvn clean verify
911

1012
after_success:
1113
- mvn jacoco:report coveralls:report
1214
- "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} == '' ]] && mvn deploy -DreposityId=sonatype-nexus-snapshots -DskipTests --settings deploy-settings.xml"
15+
- "[[ ${TRAVIS_PULL_REQUEST} == 'false' ]] && [[ ${TRAVIS_TAG} != '' ]] && mvn deploy -DreposityId=sonatype-nexus-staging -DskipTests --settings deploy-settings.xml"

README.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -177,23 +177,13 @@ You can access snapshot builds from the sonatype repository:
177177

178178

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

182182
```shell
183183
mvn clean package
184184
```
185185

186-
#### Release
187-
188-
```shell
189-
mvn build-helper:parse-version versions:set -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
190-
mvn -Psign-artifacts clean deploy
191-
```
192-
193-
#### Increment version for next release
194-
195-
Example:
196-
186+
#### Set version for next release
197187
```shell
198188
mvn build-helper:parse-version versions:set versions:commit -DnewVersion=1.0.0-SNAPSHOT
199189
```

pom.xml

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<properties>
1818
<java.version>1.7</java.version>
1919
<main.basedir>${basedir}</main.basedir>
20-
<passphrase>${gpg.passphrase}</passphrase>
2120
<spring-boot.version>1.3.0.RC1</spring-boot.version>
2221
<spring-cloud.version>Brixton.M2</spring-cloud.version>
2322
<build-plugin.jacoco.version>0.7.5.201505241946</build-plugin.jacoco.version>
@@ -102,15 +101,18 @@
102101
<profile>
103102
<id>sign-artifacts</id>
104103
<activation>
105-
<activeByDefault>false</activeByDefault>
104+
<property>
105+
<name>env.GPG_PASSPHRASE</name>
106+
</property>
106107
</activation>
107108
<build>
108109
<plugins>
109110
<plugin>
110111
<groupId>org.apache.maven.plugins</groupId>
111112
<artifactId>maven-gpg-plugin</artifactId>
112113
<configuration>
113-
<passphrase>${passphrase}</passphrase>
114+
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
115+
<homedir>${user.dir}/.gnupg</homedir>
114116
</configuration>
115117
<executions>
116118
<execution>

0 commit comments

Comments
 (0)