0

I have two Git repositories, one for the versioning of my application and the other for the versioning of the DB schema.

I would like to use a continuous integration and deployment system, so I need to link each version of the application with the corresponding version of the DB schema, so that the CI system can pull the right application and DB versions and deploy them.

Is there any way to do this thing with Git?

Thank you

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
gvdm
  • 3,006
  • 5
  • 35
  • 73
  • Consider merging everything into a single repo. – SLaks Sep 25 '15 at 16:13
  • The number of modules the application is made up of is very big. Using only one repository may bring to worst performances to the Git operations... – gvdm Sep 28 '15 at 07:17

2 Answers2

0

One approach could be to tag revisions in each repo that need to be linked together.

Then, in your CI system you could pull from the repositories based off of tag.

See https://git-scm.com/book/en/v2/Git-Basics-Tagging for more details on tagging

See Download a specific tag with Git for details on how to pull from a tag.

Community
  • 1
  • 1
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
  • And how to link the corresponding tags? I mean, the application trunk can have three tags (v1, v2, v3) and the DB schema four tags (v1, v1.3, v1.6, v2). The version numbers can be indipendent from each other in the two trunks. – gvdm Sep 28 '15 at 07:05
  • A ref (single commit) can have multiple tags. Perhaps in your use-case you can have a separate tag (non-release tag) to link the repos together. – Jonathan.Brink Sep 28 '15 at 12:29
0

Finally the solution I'm using is to link the Maven version of the DB Schema project into the pom.xml of the DAL of the web application.

This way the web application includes the right entities from the right DAL, and the DAL is related to the right DB schema by means of the Maven version.

gvdm
  • 3,006
  • 5
  • 35
  • 73