I have a project organized in the following tree
|.
|..
|-- devops
|-- project1
|-- project2
In the devops folder, I have included the other two projects as submodules, since these two projects are developed independently by two different teams.
|.
|..
|-- project1@0deed0fa
|-- project2@0beef0fb
|-- .gitlab-ci.yml
I have setup the pipeline to deploy the projects. Whenever there are new commits on any of the projects, a trigger is setup to run the devops
project pipeline. As part of the devops jobs, I run git submodule
commands to fetch and merge. Then build. It works.
The problem I have is, over a period of time, there are a lot of changes made to the submodules. The changes from the last submodule commit to the devops project folder is replayed every time there is a commit on any of the projects. Once a month, I manually update the devops
project folder and update to the latest commit of the submodule projects. I can commit the changes from the devops pipeline task, but that will generate new pipeline in the same devops pipeline. (I didn't test it but it seems obvious).
Is there any way I can update the submodules to the latest commit as part of the devops pipeline ?
Thanks.
question from:
https://stackoverflow.com/questions/65946723/how-to-update-submodules-in-a-gitlab-ci-cd 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…