Build pipeline for monorepo

116 views
Skip to first unread message

Allan M

unread,
Feb 2, 2021, 11:48:14 AM2/2/21
to go-cd
I am wondering if there is any way to tell the git revision of the last successful build of a pipeline.

I require it to inform the following command, which returns a list of changes for a given project in my monorepo.

git diff-tree --no-commit-id --name-only -r "<last_successful_revision>..<head_revision>" -- "./$project"

Looking at only the changes for the latest revision will not suffice as the diff will likely not include changes in all the same projects as the previous revision meaning I can't determine which projects to build.

Denis Troller

unread,
Feb 2, 2021, 2:18:45 PM2/2/21
to go...@googlegroups.com
Hi Alan

If you use the api you can inspect the latest runs if your pipeline.  With this you can get the counter of both runs and use it to compare runs, again through the api. This will break down changes by material between the two runs, so you can generate release notes. This is identical to using the compare feature through the UI. 

I hope this helps you
--
Denis Troller

Le 2 févr. 2021 à 17:48, Allan M <mckinl...@gmail.com> a écrit :

I am wondering if there is any way to tell the git revision of the last successful build of a pipeline.

I require it to inform the following command, which returns a list of changes for a given project in my monorepo.

git diff-tree --no-commit-id --name-only -r "<last_successful_revision>..<head_revision>" -- "./$project"

Looking at only the changes for the latest revision will not suffice as the diff will likely not include changes in all the same projects as the previous revision meaning I can't determine which projects to build.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/13ce3ef3-34e9-498d-8060-cae931ff5c2en%40googlegroups.com.

varshasva...@gmail.com

unread,
Feb 2, 2021, 2:30:18 PM2/2/21
to go-cd
Hi Allan,

There's also the `GO_TO_REVISION` and `GO_FROM_REVISION` for every pipeline run that you can use. Check out the list of standard GOCD environment variables: https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html

Thanks,
Varsha

Reply all
Reply to author
Forward
0 new messages