Lesson 1: deploy code from bitbucket or github

Lesson 1: deploy code from bitbucket or github

Lesson 1: deploy code from bitbucket or github

I know you will find hundreds of article about deploying code to server from BitBucket or Github , but I found that searching an article that will describe you all the steps from tip to toe is really a time taking tasks. I already felt this pain of searching and assembling different articles to provide me every step that inclused server side and bitbucket side configurations. This pain forced me to write this article for the community. 

So basically there are two sides of this work. 

First is your Server and Second is the bitbucket or Github , I will explain the configuration for each in 3 articles . Lets start with Server. 

Server Side 

Requirements: 

  1. ssh should be enabled on your server. if not please contact your hosting provider.
  2. ssh-keygen command should be enabled on your server. if not please contact your hosting provider.
  3. git should be enabled on your server. if not please contact your hosting provider.

Steps:

  1. login to your server through SSH, please make sure you have adminstrative permissions to run commands via ssh.

     

       ssh login    

     

  2. Once you are logged in via SSH, you need to generate ssh keys. use ssh-keygen command . you need ssh keys to take pull from bitbucket or github without asking for password by them. 

     

    ssh keygen

     

  3. Once you generate key , copy content of id_rsa.pub file under .ssh folder . if you don't know where your .ssh folder , you can check the above image. when you generate ssh keys it will tell you where it is storing id_rsa.pub file. 

     

    • use #cat path-to-.ssh-folder/id_rsa.pub
    • copy the output

       

  4. You need to paste this key in bitbucket or github under deployment key section.

     

     

  5.  Once done go back to your ssh terminal screen and start creating git repo under your web root. in my case its /public_html

     

    • git init

       

    •  

bharat

About The Author

CTO at Rhaasoft Technologies Pvt. Ltd.

Other Posts

Add new comment