Skip to content

Instantly share code, notes, and snippets.

@motlin
Last active December 9, 2023 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motlin/2b1f29eccb79825e6c43be2d60f1d7e4 to your computer and use it in GitHub Desktop.
Save motlin/2b1f29eccb79825e6c43be2d60f1d7e4 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -uxo pipefail
VOICE='Serena (Premium)'
export LIFTWIZARD_FILE_MATCH_RULE_RERECORD=true
function checkLocalModification {
git diff --quiet
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Locally modified files"
say --voice $VOICE "Locally modified files"
exit 1
fi
}
function echoSay {
echo "$1"
say --voice "$VOICE" "$1"
}
COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD)
say --voice "$VOICE" "[[volm 0.10]] Beginning build of commit: $COMMIT_MESSAGE" &
./mvnw -Dmaven.build.cache.skipCache=true clean install --threads 8C --activate-profiles !shade
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
checkLocalModification
exit 0
fi
./mvnw install --activate-profiles !shade
echoSay "Build failed on commit: $COMMIT_MESSAGE"
exit $EXIT_CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment