git+jenkins+rex presentation

13

Click here to load reader

Upload: dwi-sasongko-supriyadi

Post on 06-May-2015

330 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Git+jenkins+rex presentation

Git+Jenkins+Rex

just another git+jenkins+rex presentation

By: [email protected]

Page 2: Git+jenkins+rex presentation

What is Git?

● It's a history tracker

Page 3: Git+jenkins+rex presentation

What is Github?

● http://learn.github.com/p/intro.html

Page 4: Git+jenkins+rex presentation

What Is Jenkins?

● You can let Jenkins type for you the way you want it to be

Page 5: Git+jenkins+rex presentation

Git+Jenkins

● Just like SVN+Jenkins● Authentication

– Public key: /home/user/.ssh/id_rsa.pub

– Private key: /home/user.ssh/id_rsa

Page 6: Git+jenkins+rex presentation

Git from developer PoV

● Get the working copygit clone [email protected]:twitter/bootstrap.git

git clone https://github.com/twitter/bootstrap.git

git clone git://github.com/twitter/bootstrap.git

● Select branchgit checkout master

● Create a new working branchgit checkout -b PRODUCTBACKLOG-2000 master

git checkout -b <NEW_BRANCH> <REFERENCE_BRANCH>

git checkout -b <NEW_BRANCH> #default is current branch

Page 7: Git+jenkins+rex presentation

Git from developer PoV

● Commit changes

git commit

git commit -m

git commit -a -s

● Rebase

“Put your local changes as the latest changes from the rebasee branch on your local working copy”

Page 8: Git+jenkins+rex presentation

Rebase

● Put your local changes as the latest changes of the universe.– You have the latest status of the collaboration

branch.

– Your change is just an addition, won't conflict to others'.

– Safer than merge

– http://mislav.uniqpath.com/2013/02/merge-vs-rebase/

Page 9: Git+jenkins+rex presentation

Rebase Mechanics

Page 10: Git+jenkins+rex presentation

Git from Jenkins PoV

● Our Jenkins deploys from feature branch, NOT from integration branch

● Not from master● Not from origin/master● Why? We need it● We don't maintain build history since the

branch is inconsistent in every build

Page 11: Git+jenkins+rex presentation

Git from Jenkins PoV

● Build is parameterized– Branch's name

– Target server

● Always checkout a new copy● git checkout -b b-XyZ-PRODUCTBACKLOG-2000 origin/PRODUCTBACKLOG-2000

● Build

● Deploy to target server

Page 12: Git+jenkins+rex presentation

Rex

● An instrument to build and deploy● We have several groups of servers

– They have different purpose

– Different version of code

– Different user

● http://rexify.org● deploy/Rexfile

Page 13: Git+jenkins+rex presentation

How To Rex?

● rex -T● rex -E integration do_deploy –target=platform● rex -E staging do_deploy –target=th● Relax, it's all done by Jenkins.