
Introducing Heroku Button - ovechtrick
https://blog.heroku.com/archives/2014/8/7/heroku-button
======
swanson
Awesome - I mentioned this 400+ days ago when the platform API was announced!
Cool to see it getting rolled out, looking forward to playing around with
this.

[https://news.ycombinator.com/item?id=5793441](https://news.ycombinator.com/item?id=5793441)

EDIT: Setup was pretty smooth - one click deploy for my RSS reader now:
[https://github.com/swanson/stringer](https://github.com/swanson/stringer)

------
MaxGabriel
Heroku should consider using SVG for the badge, just like shields.io and
services like Travis CI do. The current button is blurry on a retina screen,
and basic SVG is really well supported.

~~~
mschoening
Here you go (we'll update docs momentarily):

[https://cdn.herokuapp.com/deploy/button.svg](https://cdn.herokuapp.com/deploy/button.svg)

~~~
joeyspn
You should just convert to .svg the white icon, the rest of the button will
look better in CSS.

~~~
_frog
That may be the case, but there's many contexts where you'd use this button
where you can't alter the page's CSS. Perhaps the prime example being GitHub
READMEs.

------
southpolesteve
I actually built this exact thing myself last year:
[https://github.com/southpolesteve/deploy_button](https://github.com/southpolesteve/deploy_button)

Here is a repo that has the button included:
[https://github.com/southpolesteve/lucre](https://github.com/southpolesteve/lucre)

Obviously I never really promoted it and I'm glad to see that Heroku built
something official. But maybe someone far in the future will see this comment
and remember :)

Quick edit: Here is the announcement email to the local railer's group
[https://groups.google.com/forum/#!topic/Mad-
Railers/-1MkbbkX...](https://groups.google.com/forum/#!topic/Mad-
Railers/-1MkbbkXrYg) To be clear, I have no reason to believe that Heroku used
anything I made. Just wanted to self promote a bit.

------
naaman
There's a small gallery of Heroku button templates at
[https://clone.herokuapp.com/](https://clone.herokuapp.com/)

------
jrnkntl
I think they're still working out the kinks [1], but nevertheless, great when
it works. No more 'behind' hosted demos for open-source apps, just let them
instantly deploy it and play with it on their own.

[1] Tried the sample node.js app immediately, although I am getting "Deployed
to heroku", viewing it throws a "No such app" \-
[https://www.dropbox.com/s/bsl55sia46ymrwv/Screenshot%202014-...](https://www.dropbox.com/s/bsl55sia46ymrwv/Screenshot%202014-08-07%2019.24.13.png)

~~~
korzun
Now it's throwing internal server error.

------
Dorian-Marie
Awesome, can't wait for "Deploy Discourse to Heroku", "Deploy Jekyll to
Heroku", ...

~~~
derwiki
It would be a great "growth hack" for services like that

------
benologist
This is brilliant. Are affiliate links on the roadmap? That could create a
great revenue stream for self-hosted projects.

~~~
timdorr
Does this support normal Git links? If so, you could simply link to a Gumroad
or similar site and have that send a Heroku Button link with a customized git
repo where they can deploy from.

~~~
andy_ppp
I imagine you need to set up your app to use Heroku. It's not very hard but
beware that you can't write to the filesystem with Heroku so that would need
to be factored in to the functionality of quite a few apps.

~~~
bjeanes
You can write to the file system, it's just not persistent across dyno
restarts or shared across running dynos. Writing out for in-request work is
fine.

------
mahmoudimus
This is amazing - this is something similar to the experience I want to
provide for our internal engineering team.

Most developers get stuck on packaging their app, deploying it, managing it.
This is one of those cases where it "just" works.

It would be really cool to try to replicate this in our AWS setup.

Guess I know what my weekend project will be :D

------
timdorr
Does this have to work only via Github? Any chance it can support any
arbitrary Git URI?

~~~
friism
Right now buttons only work with source code hosted on GitHub (although the
button can be added anywhere). We want to extend that to other source code
hosting services, though.

The challenge is that we have to resolve the [app.json][1] file to generate
the deploy UI.

[1]:
[https://blog.heroku.com/archives/2014/5/22/introducing_the_a...](https://blog.heroku.com/archives/2014/5/22/introducing_the_app_json_application_manifest)

~~~
Artemis2
Why not do something like the go get tool, that uses git, mercurial and
subversion to try to resolve a repo by a URL and to get its contents?

------
btown
> Note that the snippet is repo-agnostic: It can be copy-pasted without
> modification and will work correctly if forked to a different repo. Heroku
> resolves the repo originating a button click by inspecting the referer
> header.

Is the referer reliable enough on modern browsers to assume this? Perhaps
coming from an analytics perspective, we see all types of query-string hacks
so that you can attribute the sources of links everywhere... so it's
surprising to see a company depend on this functionality in a product. I
suppose almost all developers would be using a browser that correctly sends
referer headers... is this the case?

~~~
michaelmior
They do mention an alternative where you can set stuff in the query string.
I'd probably rather do that instead. Especially since you could easily end up
putting that button out of the context of your repo at some point and have it
end up completely broken.

~~~
cben
But if I fork a repo with a button (or even navigate to different
branch/commit in same repo), a manually set query string would still point to
the same code. Whereas the referer headear can identify exactly the right
version briliantly.

------
taternuts
Nice - nitrous.io has had this for awhile in their Hack Button
([https://www.nitrous.io/hack](https://www.nitrous.io/hack)), and I always
thought it was pretty cool.

------
aaronbasssett
This is amazing, it's a simple app but [https://github.com/aaronbassett/Bad-
Tools](https://github.com/aaronbassett/Bad-Tools) only needed 1 single line
change to work. Really impressed although I do need to read up more on the
app.json schema.

------
ceejayoz
This is extremely clever. One of the reasons WordPress took off was the easy,
non-technical install process.

~~~
aikah
> This is extremely clever. One of the reasons WordPress took off was the
> easy, non-technical install process.

Ironically Wordpress is a pain in the ass to deploy on "non persistent/deploy
with git" PAAS.And uploading plugins directly through the admin is a no go in
these cases.

Worpdress wouldnt deploy directly with that one click install,given the fact
the configuration is hardwritten on the disk.It would need some refactoring.

You'd need at least to enter some env variables to make things work,and the
app would need to detect the db state and run migrations,if not properly
initalized,when using a RDBMS(since again,sqlite is out of question on
Heroku).

~~~
toadkicker
All the same that Wordpress could easily adopt using environmental variables
for configuration values to achieve this and simply use a heroku-ified version
of config.php. I've used this approach for scaling wordpress sites and its
never failed me.

------
coopr
Howsabout an app that performs terribly and does nothing - except teach you to
improve your Ruby code?

Yeah, there is a button for that [https://github.com/newrelic/newrelic-ruby-
kata](https://github.com/newrelic/newrelic-ruby-kata)

------
michaelmior
Anyone else having a lot of problems getting it to work. I keep getting a
"Something went wrong" message with no additional information. Even if I
create a minimum viable app.json, nothing seems to work.

------
wildpeaks
Kudos, now that's good business: it benefits both the company (because once
you're there and it works, you're less likely to switch to another host) and
the users who want to quickstart something.

------
dinkumthinkum
I think this is a pretty innovative marketing ploy. Seems to make a blog post
very Heroku centric if you add this button but I see the benefits.

------
arikrak
They should connect this to [https://sandstorm.io/](https://sandstorm.io/)

------
serverascode
I really like this idea. Now just need to figure out something to setup to use
it...

------
gmacdon89
this is awesome.

