Skip to content

Commit 7284885

Browse files
MarcinFalkowskislonka
authored andcommitted
CircleCI: manual snapshot deployment from branch (#122)
Signed-off-by: Marcin Falkowski <[email protected]>
1 parent e296c8d commit 7284885

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ jobs:
4848
else
4949
mvn -B -s .circleci/settings.xml deploy
5050
fi
51+
elif [[ -n "${DEPLOY_BRANCH}" ]]; then
52+
echo $GPG_KEY | base64 --decode > signing-key
53+
gpg --passphrase $GPG_PASSPHRASE --import signing-key
54+
shred signing-key
55+
56+
mvn -B -s .circleci/settings-snapshots.xml deploy
5157
fi
5258
5359
- run: bash <(curl -s https://codecov.io/bash)

.circleci/settings-snapshots.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
3+
<servers>
4+
<server>
5+
<id>sonatype-nexus-snapshots</id>
6+
<username>${env.SONATYPE_USER}</username>
7+
<password>${env.SONATYPE_PASSWORD}</password>
8+
</server>
9+
</servers>
10+
<profiles>
11+
<profile>
12+
<id>ci</id>
13+
<repositories>
14+
<repository>
15+
<id>sonatype-nexus-snapshots</id>
16+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
17+
<layout>default</layout>
18+
<releases>
19+
<enabled>false</enabled>
20+
</releases>
21+
<snapshots>
22+
<enabled>true</enabled>
23+
</snapshots>
24+
</repository>
25+
</repositories>
26+
</profile>
27+
<profile>
28+
<id>signing</id>
29+
<properties>
30+
<gpg.executable>gpg</gpg.executable>
31+
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
32+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
33+
</properties>
34+
</profile>
35+
</profiles>
36+
<activeProfiles>
37+
<activeProfile>ci</activeProfile>
38+
<activeProfile>signing</activeProfile>
39+
</activeProfiles>
40+
</settings>

0 commit comments

Comments
 (0)