Create Application on Heroku
This is a very basic tutorial to get started with heroku so below
are the steps how you can create a small application and host that on
heroku
heroku login
Enter your Heroku credentials.
Email: test@gmail.com
Password: You Password
Email: test@gmail.com
Password: You Password
Then it will give you below prompt
Could not find an existing public key.
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key /root/.ssh/id_rsa.pub
Authentication successful.
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key /root/.ssh/id_rsa.pub
Authentication successful.
After this create a local directory mkdir app
heroku create –stack cedar
Above command will create a instance for you on heroku
Creating evening-mist-6047… done, stack is cedar
http://evening-mist-6047. herokuapp.com/ | git@heroku.com:evening-mist-
Now we have to initiate GIT using:
git init
Now we have to push the root branch to heroku below command will do this for us
git push heroku master
Now since we have created a application on heroku we have
to clone it and make a local instance of that so that we can start
putting our code into that for this we have to run below command
git clone git@heroku.com:evening-mist-6.git -o heroku
Above will create a local folder in our system by name of
our heroku instance and it will then ask you to connect just answer the
question as Yes
Are you sure you want to continue connecting (yes/no)? y
Please type ‘yes’ or ‘no’: yes.
Please type ‘yes’ or ‘no’: yes.
Now we have created a local instance of application we
have to place all our code here and then deploy it to remove cloud using
below command.
git commit -am “started coding” this command will give you prompt as
On branch master
#
# Initial commit
#
# Untracked files:
# (use “git add <file>…” to include in what will be committed)
#
# index.php
#
# Initial commit
#
# Untracked files:
# (use “git add <file>…” to include in what will be committed)
#
# index.php
nothing added to commit but untracked files present (use “git add” to track)
Now time to move code for that we have to use git commit command as below
git push heroku master
Counting objects: 3, done.
Writing objects: 100% (3/3), 259 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)—–> Heroku receiving push
—–> PHP app detected
—–> Bundling Apache v2.2.19
—–> Bundling PHP v5.3.6
—–> Discovering process types
Procfile declares types -> (none)
Default types for PHP -> web
—–> Compiled slug size is 21.5MB
—–> Launching… done, v3
http://evening-mist-6047. herokuapp.com deployed to Heroku
Writing objects: 100% (3/3), 259 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)—–> Heroku receiving push
—–> PHP app detected
—–> Bundling Apache v2.2.19
—–> Bundling PHP v5.3.6
—–> Discovering process types
Procfile declares types -> (none)
Default types for PHP -> web
—–> Compiled slug size is 21.5MB
—–> Launching… done, v3
http://evening-mist-6047.
bingo the application is on heroku now you can test the application by hitting the URL
http://evening-mist-6047.Source : http://www.saasanalogy.com/create-application-on-heroku/
Comments
Post a Comment