mirror of
https://github.com/InsanusMokrassar/TelegramBotTutorial.git
synced 2024-12-22 06:07:11 +00:00
26 lines
631 B
Plaintext
26 lines
631 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
function send_notification() {
|
||
|
echo "$1"
|
||
|
}
|
||
|
|
||
|
function assert_success() {
|
||
|
"${@}"
|
||
|
local status=${?}
|
||
|
if [ ${status} -ne 0 ]; then
|
||
|
send_notification "### Error ${status} at: ${BASH_LINENO[*]} ###"
|
||
|
exit ${status}
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
app=runner
|
||
|
version=0.0.0
|
||
|
server="$USER"
|
||
|
|
||
|
assert_success ../gradlew build
|
||
|
assert_success sudo docker build -t $app:"$version" .
|
||
|
assert_success sudo docker tag $app:"$version" $server/$app:$version
|
||
|
assert_success sudo docker tag $app:"$version" $server/$app:latest
|
||
|
assert_success sudo docker push $server/$app:$version
|
||
|
assert_success sudo docker push $server/$app:latest
|