Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finding a way to set the HEROKU_URL automatically #1

Open
pborreli opened this issue Feb 6, 2015 · 7 comments
Open

finding a way to set the HEROKU_URL automatically #1

pborreli opened this issue Feb 6, 2015 · 7 comments

Comments

@pborreli
Copy link
Owner

pborreli commented Feb 6, 2015

In order to keep the dyno running we have to set the HEROKU_URL env with the actual URL of your heroku 😵 http://XXXX.herokuapp.com which is not yet created when you click on Deploy on Heroku button.

That's what i'm trying to do in b87a56c but it doesn't work because heroku cli is not available from inside a dyno (makes sense)

Right now I can't find a way to config the app.json in order to set it automatically after the overall one click creation process.

maybe @dzuelke has an idea ?

@scottrobertson
Copy link

http://stackoverflow.com/a/14280500 might help?

@pborreli
Copy link
Owner Author

pborreli commented Feb 6, 2015

@scottrobertson I don't get it, do you recommend to access or export HEROKU_URL = URL at startup ?

@dzuelke
Copy link

dzuelke commented Feb 6, 2015

Why do you need the URL?

@pborreli
Copy link
Owner Author

pborreli commented Feb 6, 2015

@dzuelke it's explained here

In addition, there is one special environment variable for Heroku. The default hubot Procfile marks the process as a 'web' process type, in order to support serving http requests (more on that in the scripting docs). The downside of this is that dynos will idle after an hour of inactivity. That means your hubot would leave after an hour of idle web traffic, and only rejoin when it does get traffic. This is extremely inconvenient since most interaction is done through chat, and hubot has to be online and in the room to respond to messages. To get around this, there's a special environment variable to make hubot regularly ping itself over http. If the app is deployed to http://rosemary-britches-123.herokuapp.com/, you'd configure:

heroku config:set HEROKU_URL=http://rosemary-britches-123.herokuapp.com

@dzuelke
Copy link

dzuelke commented Feb 6, 2015

Ah. Yeah, there's not really a way right now. You could put it into the env vars section as a required var with no value, and make the description so that it tells users to pick their own app name when creating the app through the button and then set the URL accordingly.

@pborreli
Copy link
Owner Author

pborreli commented Feb 6, 2015

@dzuelke that should be really great if there was a way, that would remove one annoying step,
I will try to see if it's possible to modify hubot source code to find by itself the url, not sure if it's possible but can worth the effort, thanks for your feedback !

@hkedia321
Copy link

Hi @pborreli @dzuelke @scottrobertson I am facing exact same problem for another bot I am developing. If anyone got any solution can you please share? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants