Your Deployed Application

Before we are able to deploy on Heroku you need to make sure you have a few things installed. We will go through those requirements here to ensure you are ready to deploy in just a few simple steps.

Heroku Account
The first thing we need to do is make sure you have a Heroku account created. This will give you access to Heroku’s deployment services and will allow you to manage your deployed applications on their web app. It is free to sign up so visit the Heroku homepage and sign up for an account.

Heroku Toolbelt
The next thing you should do is install the Heroku Toolbelt. The toolbelt is a command line tool that will expand the functionality of your command line to include heroku commands. For example, once installed you will be able to use the heroku login command to log into your account from your command shell. To install the Heroku Toolbelt navigate to and follow the installation instructions for your operating system.

Heroku Login
Once you have your Heroku account and the toolbelt installed you will want to log in to your Heroku account from the command line. To do this, open up your command line shell and type heroku login. This will prompt you for your Heroku email and password. If you entered your information correctly, your command line output should look something like the image below. You won’t have to log in every time you want to deploy, your credentials will be saved for some time, so this is a good command to keep in mind if you get logged out at some point.

Git Installed
Heroku deploys the most recent version of your app by keeping track of changes via Git. Make sure that you have Git installed on your command shell. If you do not have Git installed you can visit this link to get yourself set up. Most recent MacOS machines come with Git already installed, and if you have been building applications on your development environment already, it is likely you have already been using Git.

Clone Repository Now that you have everything you need to get started, you will need to clone the gallery application you are going to deploy. Open up your command line and navigate to the location where you want the repository to live, this is often a projects directory but it can be anywhere you like on your machine as long as it is not within another Git repository. If you are not sure if there is a git repo on your working directory you can check using git status. If you get a message saying fatal: Not a git repository (or any of the parent directories): .git This means you are not in a Git repo and you can clone in this location. Go to the Udacity repository in your web browser.

In order to make updates to the codebase, you will need your own copy of the repository, which you can do from the Github page. You will need an account on Github in order to fork the repository to your own account. Click the ‘fork’ button in the upper right corner of the page (see image above) and choose your account to fork.

Once you have forked the repository, open your new repository in your web browser and copy the clone URL. Return to your command line and type git clone followed by the git clone URL you just copied. This will clone the code on GitHub to your computer.

git clone<your_github_account>/galeria

Once you have installed all the tools and cloned the repo, you are ready to go live. Let’s go ahead and change our working directory to the repository directory: cd galeria

It is generally a good idea to check your git status to make sure you are about to deploy the most updated stable version. Let’s deploy!

Heroku Create
To get yourself deployed on Heroku, you must first create a remote on Git. To do this you have to run the heroku createcommand. This will make a new remote repo named heroku where the code will be pushed to.

To ensure you have properly created this remote, run the git remote -v command, you should see something output that reveals the two remotes listed, origin and heroku.

Git Push Heroku Master
Now the last step, the ribbon cutting is the command git push heroku master. This command is very similar to the git push that you may be familiar with when pushing your code to GitHub. Instead of pushing it to github via the originremote, you are pushing it to the heroku remote.

From this point you will see a large output from Heroku that is listing all of the libraries and tools that are being installed on the Heroku machine before your code is finally decompressed and launched onto the online server.

Heroku Open
Once you have your application deployed, Heroku will provide you with a URL you can visit to see your site. After this you can run heroku open. This will open up a browser window and navigate to the deployed application URL.

Now your gallery is live! Click on the “New Art Piece” button to see a new image appear!


Published by

Mir Shaon

I'm very simple guy and punctual.I'm very hard worker and building any website actually this is my life.After graduation I'll started my own IT company Devshub so let's do something in this world.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s