我有两个 Git 存储库,一个用于我的应用程序的版本控制,另一个用于 DB 模式的版本控制。
我想使用一个持续集成和部署系统,所以我需要将应用程序的每个版本与相应版本的 DB schema 链接起来,以便 CI 系统可以拉出正确的应用程序和 DB 版本并进行部署。
有什么办法可以用 Git 做这件事吗?
谢谢
我有两个 Git 存储库,一个用于我的应用程序的版本控制,另一个用于 DB 模式的版本控制。
我想使用一个持续集成和部署系统,所以我需要将应用程序的每个版本与相应版本的 DB schema 链接起来,以便 CI 系统可以拉出正确的应用程序和 DB 版本并进行部署。
有什么办法可以用 Git 做这件事吗?
谢谢
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.
一种方法可能是在每个 repo 中标记需要链接在一起的修订。
然后,在您的 CI 系统中,您可以从基于标签的存储库中提取。
有关标记的更多详细信息,请参阅https://git-scm.com/book/en/v2/Git-Basics-Tagging
有关如何从标签中提取的详细信息,请参阅使用 Git 下载特定标签。