Trying to figure out how to handle a GH mono repo ...
# pulumi-cloud
a
Trying to figure out how to handle a GH mono repo in a CI fashion. Ideally I would like any files being changed in the repo to trigger the appropriate projects/stacks to have a preview performed as part of the PR. But all the examples and docs I can find seem to have a 1:1 between a GHA workflow step and a stack. Which seems to indicate that for every project/stack, I would need to add a different workflow step. Which could lead to a lot of previews of things not being changed for a single project or stack change.
l
Most/all CI pipeline tools can trigger pipelines on paths. For this solution, you would need multiple pipelines, in order to have just one preview per trigger. Alternatively, you could write a script that analyzes the CI env vars to determine which files/paths have changed in git, and use that to trigger a single call to
pulumi preview
.
a
seems very manual and cumbersome. nothing like atlantis out there to make this all much easier?
l
I don't know what Atlantis is, in this context. It can be manual or cumbersome. However it is also set up only once, and rarely needs to be maintained.
a
not sure i follow how its only setup once if in a mono repo. You add a new project to the repo and have to add a new workflow to handle that project. Atlantis along with terragrunt-atlantis-config allows for a true one time setup of a GHA which will automatically handle adding of projects to a mono-repo structure.
l
My monorepos have all been more static than that. Since you're talking GitHub, you can take advantage of the fact that it supports any number of entrypoint workflow files, unlike Bitbucket or GitLab, which each have one entrypoint. So you could just have a business process that each new project-within-a-monorepo creates and manages its own workflow yaml files. It'd be pretty easy to have a directory for each project within .github/workflows. So long as all the workflows specify the paths or paths-ignore filters, then it should be fairly easy to manage.