4

I'm want to store metadata per GIT repository such as which branches to use during CI/CD processes.

It seems natural to store the relevant metadata within each GIT repository, however, then the metadata itself is branched.

If I store the metadata within GIT, then each time the file is changed i.e. each time it is merged back into the master branch, the merge will trigger a build.

Question: Is there a way to ignore a specific file in (all repositories') build trigger?

I would also appreciate comments/answers on other ways to solve the root problem - storing metadata on the repositories to be used by CI/CD processes.

Alternative I am considering: Store this metadata in a database, however, then, as the metadata will not be stored near the branches, I am afraid developers may forget to set or update it.

Danny Varod
  • 17,324
  • 5
  • 69
  • 111

2 Answers2

4

If you are talking about metadata (meaning not a data stored in a file), you might consider git notes

Adds, removes, or reads notes attached to objects, without touching the objects themselves.

By default, notes are saved to and read from refs/notes/commits, but this default can be overridden.

That way, you can push those metadata, as you would for regular commits and their files.

The other workaround would be to associate a description to a branch: that is another metadata which can be pushed.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Solution I used was to create and update build definitions automatically, via code in a dedicated Devops service I wrote and set/add the ignore pattern for all builds (along with other definitions in build based on config in GIT repos).

Danny Varod
  • 17,324
  • 5
  • 69
  • 111