Deploying Revel (Golang) Using Dokku - go

Has anyone tried deploying a Revel app using Dokku?
I tried "https://www.digitalocean.com/community/tutorials/how-to-use-the-dokku-one-click-digitalocean-image-to-run-a-go-app" and it deployed successfully.
However, when I try a new Revel app, it gives me this error
remote: mv: cannot stat `/build/app/.heroku/g/bin/*': No such file or directory
This is the .godir that I created:
myappname
This is the Procfile:
myappname
What am I doing wrong?
Thanks

Since Revel is a web app (receiving incoming HTTP traffic), you need to declare a web process type in your Procfile, i.e.:
web: myappname ## Procfile requires a Unix process declaration
This tells Dokku what command to run to start the web process on the server -- in this case myappname.go in your project root.
Leave off the .go file extension in the Procfile.
Dokku is a "Docker powered mini-Heroku" so Heroku's support docs are relevant:
The unix process model is a simple and powerful abstraction for running server-side programs. Applied to web apps, the process model gives us a unique way to think about dividing our workloads and scaling up over time. The Heroku Cedar stack uses the process model for web, worker and all other types of dynos.
-- from Process Types and the Procfile - Heroku Dev Center
Note that the standard Go Buildpack for Heroku/Dokku needs either a Godeps directory, or the deprecated method of including a .godir file.

You need to use the revel buildpack instead of the Go one. The buildpack will generate the Procfile for you.
Be sure to:
Add a .env file with this in your project: BUILDPACK_URL=https://github.com/revel/heroku-buildpack-go-revel.
Add a .godir file with the argument you use to run your app, e.g. github.com/yourcompany/yourrepo.

Related

gulp command in heroku procfile

I have a node.js/express app, I would like to run the command gulp build to generate my static assets when deploying with heroku, just before my node command lcm server, as I keep my public folder in my .gitignore file.
I'm having trouble finding how I can run this command during my heroku deployment.
So far my Procfile is:
web: lcm server
This doesn't seem to work -
gulp build
web: lcm server
Make a Procfile
Begin by making a blank file named Procfile and placing it within the root of your project. Procfile is short for “Process File” and used to explicitly declare what command should be executed to start your app. By default, a Procfile is not required, but it’s good form for Node-based projects to create one.
If a Procfile isn’t defined, then one will be created automatically using npm start as the web process type.
Possible solution
Try this one:
web: node node_modules/gulp/bin/gulp build
The line above lets us use the locally installed version of Gulp provided by Node’s Package Manager (NPM) instead of having to use a globally installed version.
Helpful resources
from https://www.sitepoint.com/deploying-heroku-using-gulp-node-git/

AngularJS - Deploy on Heroku

I created a app for Angular manually, his structure and all stuff.
To run it locally I'm using http-server.
How can I deploy it to Heroku in order to inform what server to run (probably in Procfile)?
Create a Procfile just called Procfile (no extension) in the root of your app. Within that file use web: to tell heroku what to run. For example:
web: coffee server.coffee

HEROKU: ps:scale web=1 no such process type web defined in Procfile

I have seen very similar posts, that however did not help me to find a solution to my problem.
I am following step by step the guide to upload a project on heroku.
However when I type the command:
ps:scale web=1
The result is:
no such process type web defined in Procfile
I have created a file "Procfile" being careful at the capitalization. but nothing.
What else can I do to solve this problem??
Thanks in advance.
Follow on this heroku procfile
:
We have to define web process type in your Procfile and make sure name Procfile exactly, and not anything else. For example, Procfile.txt is not valid.
Example:
a: Python:
web: gunicorn gettingstarted.wsgi --log-file -
b: String MVC Hibernate
web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
This declares a single process type, web, and the command needed to run it. The name web is important here. It declares that this process type will be attached to the HTTP routing stack of Heroku, and receive web traffic when deployed.
Procfiles can contain additional process types.
worker: bundle exec rake jobs:work
Hopefully you've fixed your problem after all this time, but just in case you haven't...
I've run into this problem when my Procfile doesn't exist (a web app that I'm porting to Heroku) or doesn't match the dyno type that I'm trying to deploy (see Heroku No such process type web defined in procfile for an example of that).
You've created your Procfile, but what did you put in there? For a website Node.js app, you'll need to put in:
web: node app.js
(Obviously you'll replace app.js with index.js or wherever your app starts)
For more about Procfiles (or for other languages than Node.js), see https://devcenter.heroku.com/articles/procfile

Heroku procfile "No such process type web defined in Procfile" error

This is the first time I've used Heroku, and the fact that I can't find anyone in Google with a similar error to this means I'm likely doing something way wrong:
I'm following the basic Heroku setup guide here to get my NodeJS application deployed to the web. I'm deployed and trying to check my dynos with:
heroku ps:scale web=1
However, when I do this I get the error:
Scaling web dynos... failed
! No such process type web defined in Procfile.
When I run heroku ps I get nothing returned.
In my app's root directory, I have a file named Procfile (with no extension) which contains:
web: node app.js
The app runs locally without any issues (using foreman start).
Question is why is this occurring, how do I remedy it, should I even care?
Processes to be run on Heroku are defined in a simple text file called: Procfile
The Profile contains a line that defines how each of the processes in your application will run. This will be language specific and examples can be seen on the Heroku Devcenter Procfile article
Please note that the Procfile must be spelt exactly, with the first letter capitalized an all others lower case. There is no file extension for the Procfile. This Procfile should be placed in the root of your project and committed to your local git repository before doing a git push heroku master.
Should you mis-type the filename after it has been added to git, you can rename it using git with the command
git mv ProcFile Procfile
The renamed file will be staged so you can commit the changed file with the command
git commit -m "corrected name of Procfile"
I found the solution myself, from here: https://stackoverflow.com/a/7641259/556006
I had the same problem and I just now I found what was wrong. I first
accidently called the file ProcFile instead of Procfile. Simply
renaming that file did not get picked up by git. I had to do a git rm
ProcFile -f first and then add a new (correctly named) Procfile. After
that, it got pushed correctly by git and got picked up correctly by
Heroku.
I just had this issue myself, but in my case, I was missing a space between web: and the starting command in the Procfile.
For example, I had it wrong this way:
web:gunicorn run:app
Fixed it by adding a space after the colon:
web: gunicorn run:app
I am guessing you've never done git push heroku master -- that is, Heroku has never seen your code.

why do i get a "Procfile declares types -> (none)" even when i have the correct Procfile?

i am trying to run the bundled solr that comes with sunspot_solr gem by adding this one line to Procfile:
solr: bundle exec rake sunspot:solr:start
Procfile is spelled with a small 'f' and exists at my Rails root.
i have not yet been able to get any processes mentioned in my Procfile running on heroku.
i have checked the other questions asked on StackOverflow related to the same topic, so don't point me there:
What is the reason for "Procfile declares types -> (none)" in Heroku?
Procfile declares types -> (none) in Heroku
Usually Heroku expects at least one process named web in your Procfile:
All the language and frameworks on the Cedar stack declare a web process type, which starts the application server.
Does your program run if you change your Procfile to say this instead -
web: bundle exec rake sunspot:solr:start
?
I'm not sure that simply seeing Procfile declares types -> (none) after a push means there is an error - the Heroku 'Getting Started with Rails' article has that output at the start too; they just change their Procfile later on to run the web process instead.

Resources