Reputation: 572
I need to have the version file in my git repository.
I have release process (pipeline) that triggered manually when we decide to do release, this process should do:
Now, when I will do clone from this tag, the version file should contains the correct version.
What happened if when the tests are running (#2) someone else commit changes to the repo, does the tag that generated in #6 will contains also the changes that not tested in release process?
Does the logic of this flow is correct, or I have better way to manage the version file?
Upvotes: 0
Views: 4390
Reputation: 1328972
The version is not something stored statically, as a new revision of a file.
That is because the act of storing a new revision of that file means... the Git repository itself has a new commit, which needs to be fetch, and forces team members to merge or rebase their own work on top of that new commit.
The version is stored at build time, when building the deliverable.
For instance, in Go, you would use a flag pass to the Go linker in order to initialize a string variable.
That way, at runtime, the binary is able to produce not only the version, but any other build time information that you would chose to record.
I usually integrate that way:
That way, your program can display a lot of information about its build version.
Upvotes: 2