`forest deploy` not working as expected?

Thanks a lot for your feedback. With both of your threads about Development Workflow, this leads me to think that our documentation could be more complete on all these elements.
I’ll push your insight on our product board.

I’ll also do my best to justify the choices that were made here:

With, what I would think is a fairly standard workflow, where you have a Dev (local), Staging (remote), and Production (remote) environment, I shouldn’t need to change an env variable to a value that’s not indicative of my current environment in order to deploy to production

With the current workflow, you could:

  • Set the origin of staging to be production (either via the forest set-origin command, or via the UI)
  • Set the origin of your development environment to be staging.

Then,

  • forest push with the development environment secret would push changes to staging
  • forest deploy from the staging environment/using the staging environment secret would then deploy all the changes on staging onto production.

In case you want to deploy from dev to production, you could:

  • Set the origin of your development to be production (either via the forest set-origin command, or via the UI)
  • forest deploy

The set-origin command is handy here, as you can dynamically choose on which environment you want to deploy your Layout Changes. This command also allow you to exactly preview what you are about to deploy.

It seems like forest deploy should accept an “origin_environment” option or something of that nature

Allowing such command would mean that you would have no idea of what is going to be changed/deploy exactly. A more in-depth example is available here.

The only proper way that I have to deploy staging to production is in the UI

FOREST_ENV_SECRET=<staging env secret> forest deploy should work as well

The only limitation that we currently have is that creating a branch and pushing this branch to a Staging/deploying a branch to a production while on a development environment is only possible via the CLI.

I really hope I made it clearer, but if that’s not the case, just let me know.

2 Likes