I'm building a continous integration pipeline based on a git repository.
I have 3 branch:
- master branch for the dev environment
- test branch for the test environment
- prod branch for the prod environment
Any time a branch is updated, a pipeline update my website, eg:
- when a push on master branch is made, a pipeline update https://dev.website.com
- when a push on test branch is made, a pipeline update https://test.website.com
- when a push on prod branch is made, a pipeline update https://prod.website.com
Everytime I release a new version, I update the master branch and tag the commit whit the version number:
# procedure for deploy on dev git add -A git commit -m "1.0.0" git tag 1.0.0 git push --set-upstream origin master --tags This works...
When i want to put the 1.0.0 version into test environment this is the procedure
# procedure for deploy on test git fetch --tags origin git checkout -B test git merge 1.0.0 git push --set-upstream origin test This works... but this procedure don't work on rollback, if test branch is on version 2.0.0 the snippet don't rollback the branch on version 1.0.0. If i made a:
git show-branch *test the output show:
! [refs/remotes/origin/test] 2.0.0 * [test] 2.0.0 -- +* [refs/remotes/origin/test] 2.0.0