Created
January 13, 2016 18:45
-
-
Save j-mcnally/750b75263b714253cfb6 to your computer and use it in GitHub Desktop.
Grabbing a heroku app's URL on deployment. Useful for review apps that need the URL at runtime for mailers or wordpress.
This file contains 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
#!/bin/bash | |
APP_URL=`php -r "print json_decode('$RECEIVE_DATA', 1)[\"push_metadata\"][\"app_info\"][\"web_url\"];"` | |
echo "----> APP URL DETECTED AS: $APP_URL" | |
echo $APP_URL > appurl.txt |
This file contains 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
#!/bin/bash | |
APP_URL=`ruby -e "require 'json'; require 'uri'; puts URI.parse(JSON.parse('$RECEIVE_DATA')[\"push_metadata\"][\"app_info\"][\"web_url\"]).hostname;"` | |
echo "----> APP URL DETECTED AS: $APP_URL" | |
echo $APP_URL > app_domain.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment