In a monorepo, I'd like to run deploy after mergin...
# community-support
v
In a monorepo, I'd like to run deploy after merging to main. Common enough. What I'm thinking now, is to run a deploy on everything, something like
./gradlew deploy
, and everything already deployed will be UP-TO-DATE, so a no-op. (I'm not sure how it would know if it's already deployed, probably via a hash of the binary?) Is this a good idea to model this in the build system?
v
Probably depends on the exact circumstances. 🤷‍♂️
v
I think the actual question here is, to have my deploy task no-op if already deployed, where that check is network call against some image registry good idea in gradle?
e
I'm not sure Gradle would be a good tool for this. sure you could
Copy code
tasks.deployFoo {
    onlyIf { getLiveVersion("foo") != fooVersion }
}
but you wouldn't have a good way of seeing which deployments would actually happen before running them (
--dry-run
shows everything as
SKIPPED
regardless of
onlyIf
), which is something other tools made for this purpose like Terraform can do
v
thank you both but turns out I just reivented gitops 😀