Skip to content

Commit 5bb7ffe

Browse files
committed
Add snapshot publishing script
Signed-off-by: marko-bekhta <[email protected]>
1 parent cc73f98 commit 5bb7ffe

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

jreleaser-setup.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
# source "$SCRIPTS_DIR/jreleaser-setup.sh"
66

77
if [ -d "jreleaser" ]; then
8-
echo "JReleaser was already set up."
8+
echo "JReleaser was already set up. Skipping installation"
99
./jreleaser/bin/jreleaser --version
1010
return
1111
fi
1212

13+
echo "About to install JReleaser."
1314
wget https://github.com/jreleaser/jreleaser/releases/download/v1.17.0/jreleaser-1.17.0.zip -qO jreleaser.zip
14-
unzip jreleaser.zip
15+
unzip -qq jreleaser.zip
1516
mv jreleaser-1.17.0 jreleaser
1617
rm jreleaser.zip
1718

snapshot-deploy.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env -S bash -e
2+
3+
WORKSPACE="${WORKSPACE:-'.'}"
4+
SCRIPTS_DIR="$(readlink -f ${BASH_SOURCE[0]} | xargs dirname)"
5+
6+
PROJECT="$1"
7+
VERSION="$2"
8+
9+
if [ -z "$PROJECT" ]; then
10+
echo "ERROR: Project not supplied"
11+
exit 1
12+
fi
13+
14+
if [ -z "$VERSION" ]; then
15+
echo "ERROR: Version not supplied"
16+
exit 1
17+
fi
18+
19+
if ! [[ $VERSION =~ ^.+-SNAPSHOT$ ]]; then
20+
echo "ERROR: Supplied Version (${VERSION}) is not a SNAPSHOT"
21+
exit 1
22+
fi
23+
24+
source "$SCRIPTS_DIR/jreleaser-setup.sh"
25+
26+
if [ "$PROJECT" == "search" ] || [ "$PROJECT" == "validator" ] || [ "$PROJECT" == "tools" ] || [[ $PROJECT =~ ^infra-.+ ]]; then
27+
./mvnw -Pci-build -DskipTests clean deploy
28+
elif [ "$PROJECT" == "orm" ] || [ "$PROJECT" == "reactive" ] || [ "$PROJECT" == "models" ]; then
29+
./gradlew clean publish -x test --no-scan --no-daemon --no-build-cache --stacktrace -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com
30+
else
31+
echo "ERROR: Unknown project name $PROJECT"
32+
usage
33+
exit 1
34+
fi
35+
36+
# Execute a JReleaser command such as 'full-release'
37+
./jreleaser/bin/jreleaser full-release -Djreleaser.project.version="$VERSION"

0 commit comments

Comments
 (0)