monodeploy
monodeploy copied to clipboard
Allow for a plan > apply workflow
Is your feature request related to a problem? Please describe.
Tools like terraform provide the opportunity to plan changes, and to apply them. In this paradigm, a user can run terraform plan and get an idea of what will happen without having to do a dry-run and rely on logs. Following this, the plan can be saved and used for other purposes (optimization, record-keeping, etc), or applied, in which case changes are applied to the affected resources.
It would be really cool to have a similar flow in monodeploy. We already generate a changeset file which is very close to what a plan would be (adding commit SHAs and previous versions* as well would be good to get a complete picture), and the code is already organized as a pipeline, which would be easy to split into "plan" and "apply" stages.
The net benefit of this would be to expose the changeset such that it can be used for inspection / optimization. It would also make "plan runs" faster since right now, to get that information, you'd need to run in dry-run mode, which has overhead unrelated to planning.
Describe alternatives you've considered
Using dry-run mode. :(
Additional context
This thread is born from some chats with @noahnu around future expansion.
Once this is completed, monodeploy will be a direct replacement for https://github.com/atlassian/changesets
Putting this feature on hold and taking it out of v3.0.0. Might be introduced in a minor version bump, however I need more discussion/planning around what this looks like. I'm leaving the new config option in the v3 release however it's called out as non-functional.
I wonder if we can take this a step further and have monodeploy run all lifecycle scripts up until the "publish" before stopping. This would let us use monodeploy for building packages in a separate CI stage/job than publish.
Something like:
yarn monodeploy plan
would produce the plan file (changeset), followed by:
yarn monodeploy build --changeset-file changeset.yml
which would run everything up until "publish", followed by:
yarn monodeploy publish --changeset-file changeset.yml