2019-09-25 17:06:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ev
|
|
|
|
|
|
|
|
# Only:
|
|
|
|
# - Tagged commits
|
|
|
|
# - Security env variables are available.
|
2021-02-24 16:24:25 +00:00
|
|
|
if [ -n "$VERSION_TAG" ] && [ -n "$PROD_DEPLOYMENT_HOOK_TOKEN" ] && [ -n "$PROD_DEPLOYMENT_HOOK_URL" ]
|
2019-09-25 17:06:41 +00:00
|
|
|
then
|
|
|
|
curl --silent --output /dev/null --write-out "%{http_code}" -X POST \
|
|
|
|
-F token="$PROD_DEPLOYMENT_HOOK_TOKEN" \
|
|
|
|
-F ref=master \
|
2021-02-24 16:24:25 +00:00
|
|
|
-F "variables[TRIGGER_RELEASE_COMMIT_TAG]=$VERSION_TAG" \
|
2019-09-25 17:06:41 +00:00
|
|
|
$PROD_DEPLOYMENT_HOOK_URL
|
|
|
|
else
|
|
|
|
echo "[ERROR] Production deployment could not be prepared"
|
|
|
|
fi
|