Skip to content

Commit

Permalink
buildkite: print maven/java context (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Feb 16, 2023
1 parent bee35ac commit a1275c5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ echo "--- Configure git context :git:"
git config --global user.email "[email protected]"
git config --global user.name "apmmachine"

echo "--- Install JDK17"
echo "--- Install JDK17 :java:"
JAVA_URL=https://jvm-catalog.elastic.co/jdk
JAVA_HOME=$(pwd)/.openjdk17
JAVA_PKG="$JAVA_URL/latest_openjdk_17_linux.tar.gz"
Expand All @@ -67,4 +67,9 @@ mkdir -p "$JAVA_HOME"
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1

export JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
PATH=$JAVA_HOME/bin:$PATH
export PATH

echo "--- Debug JDK installation :coffee:"
tree "$JAVA_HOME" || true
java -version || true
9 changes: 7 additions & 2 deletions .ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ trap clean_up EXIT
# Avoid detached HEAD since the release plugin requires to be on a branch
git checkout -f "${branch_specifier}"

echo "--- Debug JDK installation :coffee:"
echo $JAVA_HOME
echo $PATH
java -version

set +x
echo "--- Release the binaries to Maven Central :maven:"
if [[ "$dry_run" == "true" ]] ; then
echo './mvnw release:prepare release:perform --settings .ci/settings.xml --batch-mode'
echo './mvnw -V release:prepare release:perform --settings .ci/settings.xml --batch-mode'
else
# providing settings in arguments to make sure they are propagated to the forked maven release process
./mvnw release:prepare release:perform --settings .ci/settings.xml -Darguments="--settings .ci/settings.xml" --batch-mode | tee release.txt
./mvnw -V release:prepare release:perform --settings .ci/settings.xml -Darguments="--settings .ci/settings.xml" --batch-mode | tee release.txt
fi
9 changes: 7 additions & 2 deletions .ci/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ clean_up () {
}
trap clean_up EXIT

echo "--- Debug JDK installation :coffee:"
echo $JAVA_HOME
echo $PATH
java -version

set +x
echo "--- Deploy the snapshot :package:"
if [[ "$dry_run" == "true" ]] ; then
echo './mvnw -s .ci/settings.xml -Pgpg clean deploy --batch-mode'
echo './mvnw -V -s .ci/settings.xml -Pgpg clean deploy --batch-mode'
else
./mvnw -s .ci/settings.xml -Pgpg clean deploy --batch-mode | tee snapshot.txt
./mvnw -V -s .ci/settings.xml -Pgpg clean deploy --batch-mode | tee snapshot.txt
fi

0 comments on commit a1275c5

Please sign in to comment.