Go 'present' on Heroku? - heroku

So I'm new to deploying servers to Heroku, I wen't through a small tutorial on how to deploy a go app to Heroku. I've been working with the present package for presentations in html5 slides. I want to add my slides to Heroku so I can access them from any computer. I'm having a hard time figuring out how to get this to work.
I know that the present binary is in the bin folder and I have my .slide markdown textfile in my $GOPATH/src folder. How can I deploy this to Heroku?
Any help would be great thanks!

Copy the present binary and your slides into some directory. git init a new branch. Then add a Procfile with the contents:
web: present --param whatever
Then just clone the buildpack:
heroku create -b https://github.com/kr/heroku-buildpack-go.git
Commit and push to heroku master. You're done.
I got all this from http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku.html

Related

How can I deploy a shiny app to Heroku

I have a shiny app and want to deploy it to Heroku. I tried to follow the steps as mentioned in:
https://github.com/btubbs/heroku-buildpack-shiny
I created a git Git repository and put the R files into it. Then, I created an app in heroku and tell Heroku to use a custom buildpack for my app. But, I was not be able to enable Heroku websockets support.
Error is:
Couldn't find that feature.
I can't figure out how to deal with this problem. Is there any other way to deploy the shiny app to Heroku?
Have you seen https://github.com/virtualstaticvoid/heroku-docker-r?
Check out the example shiny app too. To specify additional dependencies, you can still use init.R.
To deploy using Docker, you might have to move your current Heroku app to a container stack. This can be done with the heroku stack:set CLI command:
$ heroku stack:set container
Here's a minimal example. Basically:
Create run.R file with the following
library(shiny)
port <- Sys.getenv('PORT')
shiny::runApp(
appDir = getwd(),
host = '0.0.0.0',
port = as.numeric(port)
)
Commit to git
Create a new heroku app with
heroku create --buildpack https://github.com/virtualstaticvoid/heroku-buildpack-r.git
git push heroku master
That's all there is to it.
Another way would be to deploy using Docker. I am not an expert, but it took me a couple of days to deploy an app using this soluation. Many tutorials exist and could bring you to achieving this.

How to clear heroku remote repository? [duplicate]

My heroku slug size is 389mb, so push is rejected. Now the Point is, if i deploy my same application on new domain (by using heroku create again), the slug size, i am seeing is just 200mb.. Why its different? Then I have tried this approach:
Approach 1: by deleting .git folder from my project directory, then again git init. and then deploying again on same heroku app.. It didn't make any differences!
Approach 2: By declaring .slugignore file in root of project folder. But its too not making any diff!
Approach 3: as per this site, https://github.com/heroku/heroku-repo
I have reset my repo like this,
heroku repo:reset -a appname
But, nothing happened!! What to do now? Can u guide me? Thnx.
As Heroku suggests:
Inspect your slug with heroku run bash and by using commands such as ls and du
Move large assets like PDFs or audio files to asset storage
Remove unneeded dependencies and exclude unnecessary files via .slugignore
Hey I was able to find the solution. Here is what i have done:
I have downloed Heroku Repo plugin from this site :https://github.com/heroku/heroku-repo just by this line:
heroku plugins:install https://github.com/heroku/heroku-repo.git
then I have just rebuilt my app by this command:
heroku repo:rebuild -a appname
This will empty the remote repository and push the repository up again, effectively triggering an app rebuild. and I got whole working app with original downsized (207mb) again. that's it.

keep config file on heroku but remove from public repo on github?

I am trying out newrelic on a test app which is deployed to heroku.
I have both remotes origin(the public github repo) and heroku.
After pushing to heroku with the newrelic.yml file included, I would like to be able to push changes back to origin but not include the newrelic.yml file because it contains a license_key.
I tried putting config/newrelic.yml in .gitignore but it still tracks the file and pushes the file to origin. Then I tried deleting the file but can't get a clean "git status".
I tried rm config/newrelic.yml but then even with it in .gitignore the next time I push to heroku it removes the file on heroku causing newrelic monitoring to stop.
I saw other similar issues on SO with answers referring to heroku config vars https://devcenter.heroku.com/articles/config-vars but don't understand how this relates if it does, to removing the config file for github.
Thanks
Heroku take all your files from Github, each push replace all your files by the new ones. I don't think you can do something like this.
If you put your file in the .gitignore, you won't be able to push it to Heroku.
A solution may be to use branch on Github, on the master you keep your code without the config file, and on the branch "Heroku", you add the file and use it to do the push on Heroku.

heroku deployment with play framework 1.2.4 with own secure module

I have a play framework application (v1.2.4) to deploy to heroku.
I added secure module to my play app by copying the secure module from local PLAY_HOME. So that I could change Secure code to suit my project's needs.
Thus my folder structure looks like
work-root/
/play-project/ -> contains all play, libs & conf/application.conf
/secure/ -> copy of local secure module (& modified, which is why I copied. )
At the work-root, I did the following git operations:
git init
git add.
git commit -m 'first commmit with customised secure'
Please not that I didn't just commit from the play app folder (in play-project) but from a level above so that the custom secure app is also committed.
Then I created heroku app by
heroku create -s cedar --buildpack https://github.com/heroku/heroku-buildpack-pl
Which all worked.
to push code & have it deployed in heroku I did
git push heroku master
This didn't work,
~ Oops. conf/routes or conf/application.conf missing.
This is because they are not there but a level below.
I want to be able to tell Heroku that this is a play app the application.conf is in a "folder" called [play-project] & is within the current working directory.
Can someone please help me?
Many thanks Kind regards
--Rana Das
The default Play buildpack looks for those files. You can either fork the buildpack to make it work for your needs or you can switch to a more standard structure. To do what you want just go with a standard Play project layout (with the Play app in the root dir). Then for the secure module simply copy it's source into the modules/secure directory. Then Play will use your version of the module.

Using local configs in a Heroku deployment environment

I'm trying to migrate my app to Heroku - I have a config file that varies with development/staging/production environments as it contains uniquely assigned keys (from Facebook, S3, etc.), so I keep it out of the repository and keep the configs local.
As such I'm trying to find a solution for Heroku to have that config file since Heroku deploys from the repository. I noticed Heroku deploys from the master branch - can it deploy from another branch? Because then I could commit the Heroku configs there, and have it not overwrite the other environments' configs every time it pulls.
Thanks!
I believe Heroku always launches the master branch of the Gt repo, but they support config vars to address exactly this issue.
You can use foreman and heroku-config for this.
Check out the article at heroku dev center:
http://devcenter.heroku.com/articles/config-vars
I love this because you can keep the .env file in .gitignore and shield your production variables from ending up in the repository.

Resources