我正在学习CI / CD,但不清楚:
遵循Git Flow结构,请参见以下示例,按时间顺序排序:
对于新功能1:
程序员:
git checkout -b feature/1
git add .
git commit -m "something"
git push origin feature/1
On the browser and create a pull request from feature/1 to dev "Closes #1"
Gitlab-CI / Jenkins,其他人:
start the pipeline cloning the project
git checkout feature/1
execute the test jobs
if all succeed:
enable the merge request button
else:
disable the merge request button
代码审阅者:
see the pull request
authorize the pull request (click in the merge quest button)
Gitlab-CI / Jenkins,其他人:
start the pipeline cloning the project
git checkout -b release-123456 feature/1
update the config files, with the new version number
git commit -m "Update version to 123456"
execute the job package
if the job succeed:
git checkout feature/1
git merge release-123456
git push origin feature/1
git checkout dev
git merge release-123456
git push origin dev
deploy to staging
else:
git checkout feature/1
git branch -D release-123456
用于生产版本
程序员:
create a pull request from dev to master
Gitlab-CI / Jenkins,其他人:
start the pipeline cloning the project
git checkout dev
execute the test jobs
if all succeed:
enable the merge request button
else:
disable the merge request button
代码审阅者:
see the pull request
authorize the pull request (click in the merge quest button)
Gitlab-CI / Jenkins,其他人:
start the pipeline cloning the project
git checkout -b release-7890 dev
update the config files, with the new version number
git commit -m "Update version to 7890"
execute the job package
if the job succeed:
git checkout dev
git merge release-7890
git push origin dev
git checkout master
git merge dev
git push origin master
deploy to production
else:
git checkout dev
git branch -D release-7890