diff --git a/scripts/hook.sh b/scripts/hook.sh index 846a55e0..a4b97142 100755 --- a/scripts/hook.sh +++ b/scripts/hook.sh @@ -1,9 +1,21 @@ #!/bin/bash -# Send message with branch name -curl -H "Content-Type: application/json" -X POST -d '{"username": "KAMI Blue Releases", "content": "**Branch:** `'$BRANCH'`"}' "$WEBHOOK" +if [[ "$BRANCH" == "feature/master" ]]; then + # Send message with branch name + curl -H "Content-Type: application/json" -X POST -d '{"username": "KAMI Blue Releases", "content": "**Branch:** `'$BRANCH'`"}' "$WEBHOOK" -# Upload the release file -BUILD_DIR="$(readlink -f ./build/libs/)" -JAR_DIR="$(ls "$BUILD_DIR" | grep "release")" -curl -F content=@"$BUILD_DIR/$JAR_DIR" "$WEBHOOK" + # Upload the release file + BUILD_DIR="$(readlink -f ./build/libs/)" + JAR_DIR="$(ls "$BUILD_DIR" | grep "release")" + curl -F content=@"$BUILD_DIR/$JAR_DIR" "$WEBHOOK" +elif [[ "$BRANCH" == "feature/safecrystal#480" ]]; then + # Send message with branch name + curl -H "Content-Type: application/json" -X POST -d '{"username": "KAMI Blue Releases", "content": "**Branch:** `'$BRANCH'`"}' "$WEBHOOK" + + # Upload the release file + BUILD_DIR="$(readlink -f ./build/libs/)" + JAR_DIR="$(ls "$BUILD_DIR" | grep "release")" + curl -F content=@"$BUILD_DIR/$JAR_DIR" "$WEBHOOK" +else + exit 0 +fi