ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Git+Jenkins+Rex



just another git+jenkins+rex presentation

        By: ruckuus@gmail.com
What is Git?
¡ñ   It's a history tracker
What is Github?
¡ñ   http://learn.github.com/p/intro.html
What Is Jenkins?
¡ñ   You can let Jenkins type for you the way you
    want it to be
Git+Jenkins
¡ñ   Just like SVN+Jenkins
¡ñ   Authentication
    ¨C   Public key: /home/user/.ssh/id_rsa.pub
    ¨C   Private key: /home/user.ssh/id_rsa
Git from developer PoV
¡ñ   Get the working copy
      git clone git@github.com:twitter/bootstrap.git
      git clone https://github.com/twitter/bootstrap.git
      git clone git://github.com/twitter/bootstrap.git
¡ñ   Select branch
      git checkout master
¡ñ   Create a new working branch
      git checkout -b PRODUCTBACKLOG-2000 master
      git checkout -b <NEW_BRANCH> <REFERENCE_BRANCH>
      git checkout -b <NEW_BRANCH> #default is current branch
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¡±
Rebase
¡ñ   Put your local changes as the latest changes
    of the universe.
    ¨C   You have the latest status of the collaboration
        branch.
    ¨C   Your change is just an addition, won't conflict to
        others'.
    ¨C   Safer than merge
    ¨C   http://mislav.uniqpath.com/2013/02/merge-vs-
        rebase/
Rebase Mechanics
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
Git from Jenkins PoV
¡ñ   Build is parameterized
     ¨C   Branch's name
     ¨C   Target server

¡ñ   Always checkout a new copy
¡ñ   git checkout -b b-XyZ-PRODUCTBACKLOG-2000 origin/PRODUCTBACKLOG-2000
¡ñ   Build
¡ñ   Deploy to target server
Rex
¡ñ   An instrument to build and deploy
¡ñ   We have several groups of servers
    ¨C   They have different purpose
    ¨C   Different version of code
    ¨C   Different user
¡ñ   http://rexify.org
¡ñ   deploy/Rexfile
How To Rex?
¡ñ   rex -T
¡ñ   rex -E integration do_deploy ¨Ctarget=platform
¡ñ   rex -E staging do_deploy ¨Ctarget=th
¡ñ   Relax, it's all done by Jenkins.

More Related Content

Git+jenkins+rex presentation

  • 1. Git+Jenkins+Rex just another git+jenkins+rex presentation By: ruckuus@gmail.com
  • 2. What is Git? ¡ñ It's a history tracker
  • 3. What is Github? ¡ñ http://learn.github.com/p/intro.html
  • 4. What Is Jenkins? ¡ñ You can let Jenkins type for you the way you want it to be
  • 5. Git+Jenkins ¡ñ Just like SVN+Jenkins ¡ñ Authentication ¨C Public key: /home/user/.ssh/id_rsa.pub ¨C Private key: /home/user.ssh/id_rsa
  • 6. Git from developer PoV ¡ñ Get the working copy git clone git@github.com:twitter/bootstrap.git git clone https://github.com/twitter/bootstrap.git git clone git://github.com/twitter/bootstrap.git ¡ñ Select branch git checkout master ¡ñ Create a new working branch git checkout -b PRODUCTBACKLOG-2000 master git checkout -b <NEW_BRANCH> <REFERENCE_BRANCH> git checkout -b <NEW_BRANCH> #default is current branch
  • 7. 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¡±
  • 8. Rebase ¡ñ Put your local changes as the latest changes of the universe. ¨C You have the latest status of the collaboration branch. ¨C Your change is just an addition, won't conflict to others'. ¨C Safer than merge ¨C http://mislav.uniqpath.com/2013/02/merge-vs- rebase/
  • 10. 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
  • 11. Git from Jenkins PoV ¡ñ Build is parameterized ¨C Branch's name ¨C Target server ¡ñ Always checkout a new copy ¡ñ git checkout -b b-XyZ-PRODUCTBACKLOG-2000 origin/PRODUCTBACKLOG-2000 ¡ñ Build ¡ñ Deploy to target server
  • 12. Rex ¡ñ An instrument to build and deploy ¡ñ We have several groups of servers ¨C They have different purpose ¨C Different version of code ¨C Different user ¡ñ http://rexify.org ¡ñ deploy/Rexfile
  • 13. How To Rex? ¡ñ rex -T ¡ñ rex -E integration do_deploy ¨Ctarget=platform ¡ñ rex -E staging do_deploy ¨Ctarget=th ¡ñ Relax, it's all done by Jenkins.