forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease-heroku
executable file
·31 lines (28 loc) · 916 Bytes
/
release-heroku
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# [start-readme]
#
# Light Bash wrapper for the Heroku release command, which sometimes fails
# unexpectedly in staging environments when a Node installation is missing
#
# [end-readme]
# Check for node but don't fail immediately if it's not present
./script/check-for-node
EXIT_STATUS=$?
# If node is missing...
if [[ "$EXIT_STATUS" -ne "0" ]]; then
# Fail hard if this is our Heroku production app or if Redis is configured
if [[ "$HEROKU_PRODUCTION_APP" == "true" || -n "$REDIS_URL" ]]; then
echo "Error: cannot execute the release script without Node.js, which is fatal."
echo "Exiting..."
exit $EXIT_STATUS
# Otherwise succeed with only a warning
else
echo "Warning: although Node.js is missing, it is non-critical."
echo "Exiting..."
exit 0
fi
else
# Execute the release script and exit with its status
node script/purge-redis-pages.js
exit $?
fi