Automate git fetch and git reset --hard version

Viewed 45

I’ll tell you what procedure we do in our devops area when we have to deploy a new app label.

The Infrastructure is located in Amazon, we have two gitlab in different regions, one gitlab for dev environment and one for prod environment.

When a new tag for the application is created from the dev area, I run git fetch --tags from my local computer.

Then I upload the new tags by doing a git push --tags to the instance that requires the new tag. From the instance I run the following:

git fetch --tags

git reset --hard version_number (example git reset --hard 1.0)

I can’t find a git module in ansible to make a git fetch, is there any form to automate this?

I can use ansible or other service, I don’t know how to do it since I am new to ci/cd.

Any help?

0 Answers
Related