mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 11:46:23 +00:00
Add script to notify on heroku deploys (#15286)
* add script for heroku to notify about a deploy * add emoji to server name * add fallback for when script is run outside of git repo * make script use bash * remove exit
This commit is contained in:
parent
09a0e75351
commit
f9d3c6ed48
2 changed files with 26 additions and 1 deletions
25
.heroku/report_deploy.sh
Executable file
25
.heroku/report_deploy.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DEVELOPER="someone"
|
||||||
|
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
|
DEVELOPERS=$(git log -5 --pretty=format:'%an')
|
||||||
|
IFS=$'\n'
|
||||||
|
DEVELOPER=""
|
||||||
|
for dev in $DEVELOPERS
|
||||||
|
do
|
||||||
|
if [ "$DEVELOPER" == "someone" ]; then
|
||||||
|
if [[ ${dev} != *"[bot]"* ]]; then
|
||||||
|
DEVELOPER=$dev
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
PARTS=$(cut -d"." -f1 <<< $BASE_URL)
|
||||||
|
SERVER_NAME=$(cut -d"/" -f3 <<< ${PARTS[0]})
|
||||||
|
|
||||||
|
SERVER_NAME=":$SERVER_EMOJI: $SERVER_NAME"
|
||||||
|
|
||||||
|
wget $SLACK_DEPLOY_URL --post-data="{\"server_name\": \"$SERVER_NAME\", \"developer\": \"$DEVELOPER\", \"base_url\": \"$BASE_URL\"}" -O /dev/null
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
"mongo:dev": "run-rs -v 5.0.23 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet",
|
"mongo:dev": "run-rs -v 5.0.23 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet",
|
||||||
"postinstall": "git config --global url.\"https://\".insteadOf git:// && gulp build && cd website/client && npm install",
|
"postinstall": "git config --global url.\"https://\".insteadOf git:// && gulp build && cd website/client && npm install",
|
||||||
"apidoc": "gulp apidoc",
|
"apidoc": "gulp apidoc",
|
||||||
"heroku-postbuild": "npm run client:build"
|
"heroku-postbuild": ".heroku/report_deploy.sh"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^1.7.4",
|
"axios": "^1.7.4",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue