Lowercase status input & handle cancelled status

This commit is contained in:
Ole Christian Lanfjæran
2019-09-05 14:38:59 +02:00
parent 35f78347ea
commit 2af1cee25c

View File

@@ -7,13 +7,18 @@
# $1 - The deployment state
# $2 - The deployment description
#
set -e
BASEDIR=$(dirname "$0")
DEPLOYMENT_ID=$("${BASEDIR}"/deployment-get-id)
DEPLOY_STATE="${1}"
DEPLOY_STATE=$(echo "${1}"|tr [A-Z] [a-z])
DEPLOY_DESC="${2}"
if [ "$DEPLOY_STATE" == "cancelled" ]; then
DEPLOY_STATE="inactive"
fi
[ -n "${DEPLOY_DESC}" ] || DEPLOY_DESC="Deploying from GitHub Actions"
echo "Setting status to ${DEPLOY_STATE} for deployment-id '${DEPLOYMENT_ID}'"