GIT Distributed Integration Workflows
Background
- team members in different geographical locations; no face time.
- different timezone; work independently.
- one US-based integration manager who is customers, analysts, and QA facing
- integration manager has read/write access to official repository
- team members have read access to official repository
- each team member manages his own private and public repositories.
- company/project.git is a shared bare repo
Workflows
- Team member will
- set up a personal public repository accessible to integration manager
- su - member1
- cd /home/member1
- mkdir project.git
- cd project.git
- git --bare init --shared
- set up a private repository by cloning of the official repository
- cd ~/repos/git
- git clone https://github.com/company/project.git
- cd ~/repos/git/project
- git config --global user.name "Your Name"
- git remote add personal_public member1@<server name>:project.git
- create a new local branch in preparation of making changes
- commit changes to local branch
- git add .
- git commit -m "comment"
- push local branch to personal public repository
- git push personal_public dev:dev
- tag release
- git tag v1.2
- git push personal_public v1.2
- email integration manager of integration request
- Integration Manager
- set up a personal private repository by cloning of the official repository
- cd ~/repos/git
- git clone https://github.com/company/project.git
- cd ~/repos/git/project
- git remote add member1 member1@<server name>:/home/member1/project.git
- fetch and merge remote branch
- git fetch member1
- git branch -a
- git log -p master..member1/dev
- git merge --log member1/dev
- fetch and merge individual files
- git fetch member1
- git branch -a
- git log -p master..member1/dev
- git checkout member1/dev <file name>
- fetch, exclude individual files from merge
- git fetch member1
- git checkout dev
- dev is a remote branch on member1
- cannot "git checkout member1/dev" as that results in detached HEAD
- git checkout HEAD~1 <file name>
- git commit -m "exclude files from merge"
- git checkout master
- git merge --log dev
- push to the official github repository
- push tag
- git tag -l
- git push origin v1.2
- push to heroku
- ssh-add -D
- ssh-add ~/.ssh/id_rsa
- cd ~/deploy/git
- git clone git@heroku.com:project.git -o heroku
- cd ~/deploy/git/project
- git remote add github https://github.com/company/project.git
- git fetch github
- git log -p master..github/master
- git merge --log github/master
- git push heroku
- manual packaging and release management
- set up a remote release repository
- mkdir official.git
- cd official.git
- git --bare init --shared
- package a local dev branch
- git checkout dev
- git branch v1.0
- git checkout v1.0
- bundle package --all
- git add vendor/cache
- git commit -m "v1.0 release"
- push official release
- git remote add official-releases integrator@release-server:official.git
- git push official-releases v1.0:v1.0
- clean slate deployment of an official release
- mkdir new-release
- cd new-release
- git clone integrator@release-server:official.git .
- git checkout v1.0
- bundle install --local
No comments:
Post a Comment