Skip to content

Instantly share code, notes, and snippets.

@j-mcnally j-mcnally/Php.sh
Created Jan 13, 2016

Embed
What would you like to do?
Grabbing a heroku app's URL on deployment. Useful for review apps that need the URL at runtime for mailers or wordpress.
#!/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
#!/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
You can’t perform that action at this time.