Commit ed2f11ad authored by johandegn's avatar johandegn
Browse files

Updated deploy script comments and more descriptive deploy msg

parent 773ae069
Pipeline #52186 passed with stage
in 44 seconds
...@@ -57,25 +57,28 @@ function deploy { ...@@ -57,25 +57,28 @@ function deploy {
} }
base_url="registry.gitlab.au.dk/exsys2021/da6/hold-afstand/" base_url="registry.gitlab.au.dk/exsys2021/da6/hold-afstand/"
slack_msg="A new version of the website has been deployed! Check it out: https://vm34.exsys2021.cs.au.dk/"
something_deployed=1
# deploy new server if available
result=1 result=1
deploy ${base_url}"server" "server" "--network-alias server" deploy ${base_url}server "server" "--network-alias server"
if [ $result -eq 0 ]; then server_deployed=$result
something_deployed=0
fi
echo echo
# deploy new web if available
result=1 result=1
deploy ${base_url}"web" "web" "-p 80:80" deploy ${base_url}web "web" "-p 80:80"
if [ $result -eq 0 ]; then web_deployed=$result
something_deployed=0
fi
if [ $something_deployed -eq 0 ]; then # if anything has been deployed, notify the devs
if [ $server_deployed -eq 0 ] || [ $web_deployed -eq 0 ]; then
[ $server_deployed -eq 0 ] && msg="backend"
[ $web_deployed -eq 0 ] && [ $server_deployed -eq 0 ] && msg=${msg}" and "
[ $web_deployed -eq 0 ] && msg=${msg}"frontend"
slack_msg="A new version of the ${msg} has been deployed! Check it out: https://vm34.exsys2021.cs.au.dk/"
echo $slack_msg
# notify slack channel # notify slack channel
/home/auuser/slack-notifier.sh $slack_msg /home/auuser/slack-notifier.sh $slack_msg
fi fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment