First Step To DevOps: Git
First step to DevOps: Git
The main motive of this post is to be familiar to git, and how git makes developers life easier.In this case we have 3 Virtual Machines 1 for git repository and two clients . we have gituser on git server , gituser1 and gituser2 on other two machines (clients) i.e local work space for developers. The Entire setup looks some thing like this.
So lets get started :Step 1: Make a Resource Group and Attach a Virtual Network to it with default subnet
Step 2: Create 3 Virtual Machines attach it to RG and Vnet
After creating 3 VMs our resource group should look something like this:
we have:
GitServer - 10.1.0.4(gituser)
GitClient1 - 10.1.0.5 (gituser1)
GitClient2 - 10.1.0.6(gituser2)
Environment Setup:
Step 3: Install git-core on all the three machines
Step 4: Create a group osgroupdevelopers and add gituser to it on GitServer:
Step 4.1 : Create a Bare Repository on GitServer:
Step 5: Setup password less authentication b/w gituser of GitServer with gituser1 and gituser 2 on two clients5.1: Login to GitClient1 as gituser1 Create Public/private key copy Public key to gituser@10.1.0.4
5.2: Login to GitClient2 as gituser2 Create Public/private key copy Public key to gituser@10.1.0.4
Now Our Environment is all set to Start Development.Till now we have created a bare repository on server and have allowed access to two users gituser1 and gituser2
Development :
gituser1 on gitclient1 initiates the development of a project for osgroup by creating a local folder on his machine laying foundation to the project with readme file which contains information about the project . he/she adds the file to staging area then commits with some commit message and finally pushes the code to gitserver@10.1.0.4:<pathtoprojectfolder>
Before that he need to configure his username and email
gituser1 has craeted a project and pushed his changes to the gitserver we have another developer gituser2 now this changes should be visible to gituser2 and he should be able to make changes and start the development
For this gituser2 will make a folder in its home directory with any name go inside that folder and clone the repository from the server and he should see all the changes done prior to cloning and he also has to configure user.name and user.email lets do it
Now git user pushes the changes to the repository:
Now gituser1 pulls the changes that is done by other developer , so that any bug in the code can be fixed for that , gituser1 changes the code and commits with proper message back to repository so that next time gituser2 updates his local workspace with code in repository can see if the code still has a bug if yes then fixes and starts other part of code
gituser1 also creates new code and pushes that to repository.
And Development Continues like this .. i will be covering how we handle conflicts and other features
Thanks you !!!!
HAPPY DevOps!!!!
3 comments:
It helped me alot.. Thanks Shailesh !!!
Hey Good work!!!! Keep Posting i am eagerly waiting for your next post on devops... Could you post something on JAVA and Angular.js
It is really a great work and the way in which you are sharing the knowledge is excellent.Thanks for your informative article
Devops Online Training
Post a Comment