Last active
May 23, 2016 15:36
-
-
Save bjeanes/9ff47f4438bfa121ce8f57f7a51884a8 to your computer and use it in GitHub Desktop.
Attempt to add a Heroku labs feature to specified app(s) until
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ### Attempt to add a Heroku labs feature to specified app(s) until success | |
| # Originally created for limited availability `http-sni` to try to get in as allocation opened up. | |
| # Call with ./labs-enable.sh <lab-feature> <app1> [<app2> ...] | |
| feature=$1 | |
| enable_apps() { | |
| if [ $# -gt 0 ]; then | |
| echo "Attempting to enable $feature for $1" | |
| until heroku labs:enable $feature -a $1; do | |
| echo "[`date +"%H:%M:%S"`] Waiting 5 minutes..." | |
| sleep 300 # 5 minutes | |
| done | |
| echo "" | |
| echo "" | |
| echo "" | |
| shift | |
| enable_apps $* | |
| fi | |
| } | |
| shift | |
| enable_apps $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment