File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11web : NODE_ENV=production node server.js
22
3- release : NODE_ENV=production node script/purge-redis-pages.js
3+ release : NODE_ENV=production script/release-heroku
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # [start-readme]
4+ #
5+ # Light Bash wrapper for the Heroku release command, which sometimes fails
6+ # unexpectedly in staging environments when a Node installation is missing
7+ #
8+ # [end-readme]
9+
10+ # Check for node but don't fail immediately if it's not present
11+ ./script/check-for-node
12+ EXIT_STATUS=$?
13+
14+ # If node is missing...
15+ if [[ " $EXIT_STATUS " -ne " 0" ]]; then
16+ # Fail hard if this is our Heroku production app or if Redis is configured
17+ if [[ " $HEROKU_PRODUCTION_APP " == " true" || -n " $REDIS_URL " ]]; then
18+ echo " Error: cannot execute the release script without Node.js, which is fatal."
19+ echo " Exiting..."
20+ exit $EXIT_STATUS
21+ # Otherwise succeed with only a warning
22+ else
23+ echo " Warning: although Node.js is missing, it is non-critical."
24+ echo " Exiting..."
25+ exit 0
26+ fi
27+ fi
28+
29+ # Execute the release script and exit with its status
30+ node script/purge-redis-pages.js
31+ exit $?
You can’t perform that action at this time.
0 commit comments