2022-09-04 09:46:45 +00:00
|
|
|
#!/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=plaguposter
|
2023-03-12 16:49:34 +00:00
|
|
|
version="`grep ../gradle.properties -e "^version=" | sed -e "s/version=\(.*\)/\1/"`"
|
2022-09-09 16:59:49 +00:00
|
|
|
server=docker.io/insanusmokrassar
|
2022-09-04 09:46:45 +00:00
|
|
|
|
|
|
|
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
|