Skip to content

Commit befc15c

Browse files
committed
CI
1 parent 39ada4e commit befc15c

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
ARTIFACTORY_PSW: ${{ secrets.ARTIFACTORY_PASSWORD }}
3535
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
3636
BUILD_NUMBER: "${{ github.run_id }}"
37-
run: ci/snapshot.sh
37+
run: ci/deploy-artifactory.sh
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/bin/bash
22

3-
set -euo pipefail
4-
MAVEN_OPTS=./mvnw -s settings.xml -Pci,snapshot,artifactory \
3+
#set -euo pipefail
4+
5+
PROJECT_VERSION=$(./ci/get-version.sh)
6+
7+
if [[ "$PROJECT_VERSION" == *SNAPSHOT ]]; then
8+
9+
echo "Deploying snapshot to Artifactory"
10+
./mvnw -s settings.xml -Pci,snapshot,artifactory \
511
-Dartifactory.server=https://repo.spring.io \
612
-Dartifactory.username=${ARTIFACTORY_USR} \
713
-Dartifactory.password=${ARTIFACTORY_PSW} \
@@ -10,3 +16,8 @@ MAVEN_OPTS=./mvnw -s settings.xml -Pci,snapshot,artifactory \
1016
-Dartifactory.build-number=${BUILD_NUMBER} \
1117
-Dmaven.test.skip=true \
1218
clean deploy -U -B
19+
else
20+
echo "Skipping Artifactory deployment, not a snapshot version."
21+
fi
22+
23+

ci/get-version.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
RAW_VERSION=`./mvnw \
6+
org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \
7+
-Dexpression=project.version -q -DforceStdout`
8+
9+
# Split things up
10+
VERSION_PARTS=($RAW_VERSION)
11+
12+
# Grab the last part, which is the actual version number.
13+
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}

ci/version.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@
22

33
set -euo pipefail
44

5-
RAW_VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-vault" ./mvnw \
6-
org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \
7-
-Dexpression=project.version -q -DforceStdout`
8-
9-
# Split things up
10-
VERSION_PARTS=($RAW_VERSION)
11-
12-
# Grab the last part, which is the actual version number.
13-
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}
5+
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-vault" ./ci/get-version.sh

0 commit comments

Comments
 (0)