Skip to content

Deployment

José Eduardo Sánchez Yépiz edited this page May 17, 2020 · 3 revisions

We currently use Heroku to host our web site. Heroku is a free (also has paid plans) platform to deploy applications online. In this article you will fiund the deployment instructions for our Heroku server.

Pre-requisites

  • Access to RoBorregos account in Heroku.
  • Third party software Heroku CLI (Command Line Interface).

Server creation

There are two ways to setup a heroku server: you can either start a hroku server from your terminal and deploy content, or you can create a heroku server from the web ui and link it to your existing project. In this case, we are going to describe how to follow the second options.

  1. Fire up a terminal and login to heroku from it:

    $ heroku login

this command will open a heroku authentication view in your default browser.

  1. Click on "Create a new app" and fill the information required about the new app.

That's it! You are all set up to start deploying to production. Is that simple!

First time setup

Now that you have created an application in heroku, it's time to deploy some stuff so you can see it working!

  1. Fire up a terminal and login to heroku:

    $ heroku login
  2. In the web ui from heroku go to your project'information and click on the "Deploy" tab. In this tab you can see different methods to deploy an existing app to heroku, but we are going to focus on the Heroku Git merthod (using Heroku CLI).

  3. In your terminal, go into the project's directory:

    $ cd roborregos-web
  4. At the bottom if this view, in the "Existing Git repository" section, you will be able to se a command. Something linke:

    $ heroku git:remote -a roborregos-web

Run that command in yout terminal to add the remote reference in your local project.

Deployments

Once you have all the setup correctly executed, you should have your local project references to heroku as the current server. So you only will neeed to push your master branch into heroku's master branch to deploy the current application, just as you do with github.

  1. Add the latest changes:

    $ git add .
  2. Commit the changes:

    $ git commit -m 'Releases vX.X.X'
  3. Deploy the latest changes into heroku's master branch:

    $ git push heroku master

NOTE: Heroku only deploys its master branch, so that is why it is important that every new release is pushed to Heroku's master.

References

If you want to learn more about about deployment with Heroku, you can visit the Heroku's Deployment documentation, where you would find different deployment methods, others than the one described in this wiki.

Clone this wiki locally