Skip to content

Commit 666c52c

Browse files
committed
Change how the JReleaser gets downloaded
Signed-off-by: marko-bekhta <[email protected]>
1 parent 07b5f77 commit 666c52c

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

deploy.sh

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env -S bash -e
22

3+
EXTRA_JRELEASER_ADDITIONAL_OPTIONS=''
4+
5+
while getopts 'd:' opt; do
6+
case "$opt" in
7+
d)
8+
# Dry run
9+
echo "DRY RUN: will not push/deploy/publish anything."
10+
EXTRA_JRELEASER_ADDITIONAL_OPTIONS='--dry-run'
11+
;;
12+
\?)
13+
usage
14+
exit 1
15+
;;
16+
esac
17+
done
18+
319
SCRIPTS_DIR="$(readlink -f ${BASH_SOURCE[0]} | xargs dirname)"
420

521
PROJECT=$1
@@ -48,14 +64,17 @@ else
4864

4965
if [ -f "./jreleaser.yml" ]; then
5066
# JReleaser-based build
51-
EXTRA_JRELEASER_ADDITIONAL_OPTIONS=''
52-
if [ "$PUSH_CHANGES" == 'false' ] ; then
53-
EXTRA_JRELEASER_ADDITIONAL_OPTIONS='--dry-run'
54-
fi
55-
5667
export JRELEASER_GPG_HOMEDIR="$RELEASE_GPG_HOMEDIR"
57-
curl https://jreleaser.org/setup.sh -sSfL | sh
58-
jreleaser full-release -Djreleaser.project.version="$RELEASE_VERSION" $EXTRA_JRELEASER_ADDITIONAL_OPTIONS
68+
# Get the jreleaser downloader
69+
curl -sL https://git.io/get-jreleaser > get_jreleaser.java
70+
# Download JReleaser with version = <version>
71+
# Change <version> to a tagged JReleaser release
72+
# or leave it out to pull `latest`.
73+
java get_jreleaser.java
74+
# Let's check we've got the right version
75+
java -jar jreleaser-cli.jar --version
76+
# Execute a JReleaser command such as 'full-release'
77+
java -jar jreleaser-cli.jar -Djreleaser.project.version="$RELEASE_VERSION" $EXTRA_JRELEASER_ADDITIONAL_OPTIONS
5978
fi
6079
fi
6180

publish.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ if [ -z "$DEVELOPMENT_VERSION" ]; then
7373
echo "ERROR: Development version not supplied"
7474
exit 1
7575
fi
76+
if [ "$PUSH_CHANGES" != "true" ]; then
77+
ADDITIONAL_OPTIONS="-d"
78+
fi
7679

7780
RELEASE_VERSION_FAMILY=$(echo "$RELEASE_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/')
7881

@@ -90,7 +93,7 @@ if [ "$PROJECT" == "orm" ] || [ "$PROJECT" == "reactive" ]; then
9093
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION \
9194
-PdocPublishBranch=production -PgitRemote=origin -PgitBranch=$BRANCH
9295
else
93-
bash -xe "$SCRIPTS_DIR/deploy.sh" "$PROJECT"
96+
bash -xe "$SCRIPTS_DIR/deploy.sh" $ADDITIONAL_OPTIONS "$PROJECT"
9497
if [[ "$PROJECT" != "tools" && "$PROJECT" != "hcann" && ! $PROJECT =~ ^infra-.+ ]]; then
9598
exec_or_dry_run bash -xe "$SCRIPTS_DIR/upload-distribution.sh" "$PROJECT" "$RELEASE_VERSION"
9699
exec_or_dry_run bash -xe "$SCRIPTS_DIR/upload-documentation.sh" "$PROJECT" "$RELEASE_VERSION" "$RELEASE_VERSION_FAMILY"

0 commit comments

Comments
 (0)