Skip to content

Commit

Permalink
Merge pull request #122 from gisaia/chore/send_message
Browse files Browse the repository at this point in the history
Send message at the end of the release
  • Loading branch information
MohamedHamouGisaia authored Jan 31, 2025
2 parents af3916c + 9a45075 commit bffce5a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -o errexit -o pipefail

export RELEASE_COMMAND_LINE="$0 $*"

SCRIPT_DIRECTORY="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
PROJECT_ROOT_DIRECTORY="$SCRIPT_DIRECTORY"

Expand Down Expand Up @@ -59,6 +61,17 @@ usage(){
exit 1
}

send_chat_message(){
MESSAGE=$1
if [ -z "$GOOGLE_CHAT_RELEASE_CHANEL" ] ; then
echo "Environement variable GOOGLE_CHAT_RELEASE_CHANEL is not definied ... skipping message publishing"
else
DATA='{"text":"'${MESSAGE}'"}'
echo $DATA
curl -X POST --header "Content-Type:application/json" $GOOGLE_CHAT_RELEASE_CHANEL -d "${DATA}"
fi
}

#########################################
#### Parsing arguments ##################
#########################################
Expand Down Expand Up @@ -307,4 +320,6 @@ if [ "$RELEASE" == "YES" ]; then
git add openapi/openapi.yaml
git commit -a -m "development version ${ARLAS_DEV_VERSION}-SNAPSHOT"
git push origin develop
send_chat_message "Release of arlas_cli, version ${ARLAS_persistence_VERSION}"
send_chat_message "${RELEASE_COMMAND_LINE}"
else echo "=> Skip git push develop"; fi

0 comments on commit bffce5a

Please sign in to comment.