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.
- ssh should be enabled on your server. if not please contact your hosting provider.
- ssh-keygen command should be enabled on your server. if not please contact your hosting provider.
- git should be enabled on your server. if not please contact your hosting provider.
- login to your server through SSH, please make sure you have adminstrative permissions to run commands via ssh.
- 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.
- 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
- git init