I'm using gocd continious delivery tool + git. My project consists of many subprojects. I don't want to rebuild all subprojects on each commit and thus created one pipeline for each subproject. I know, that for each pipeline, say for project1, I have to choose appropriate working dir and run smth like that:
- get git commit which triggered gocd build.
- detect whether changes in that commit contain project1 folder
- if changes in whole project also affected project1 folder run custom build command for project1.
How may I get commit from gocd which triggered current build? Is it simply git's latest commit or not? I thing latest commit is not safe option in case of many concurrent commits, that's why I want to get it directly from gocd - I hope it stores it for each build trigger event. How detect commit affects on folder in bash?
As you said, you are using a different pipeline for each sub project.
For a quick hack, you can use the "Blacklist" field when adding a material. It basically says the pipeline, not to trigger(start building) when these files(entered in the Blacklist field) are changed in the commit.
I know, it is a bit tricky, but if you don't change your sub-poject folders more often, this can solve your problem.
Hope this helps :)