Hi :wave: Just a heads up for anyone struggling w...
# ask-community
y
Hi 👋 Just a heads up for anyone struggling with having: multiple workspaces (staging and production for example) + schedule CRON deployments + single prefect.yaml file + single repo + push work pools (https://docs.prefect.io/2.14.2/guides/prefect-deploy/). The problem would be that you would probably want the CRON to be only active and running in the production workspace, and have it disabled in the staging workspace. But you still want a single yaml file and a single repo. We’ve did a nice workaround:
We have two github actions
deploy-to-staging deploy-to-prod
They exactly the same, but the staging one have an additional line:
This python script just deletes the “schedule” property from the yaml file before running prefect deploy --all
🙌 1
Hope someone finds this useful.
k
I did something really similar to this that I called select_actions.py to choose from a bunch of predefined actions in the yaml and copy them onto specific deployments. I was on bitbucket at the time and I created a little drop-down menu where I could pick which things I wanted to happen in the CI pipeline when deploy ran. Hopefully that at least validates that what you're doing here is totally reasonable if using yaml-defined deployments.
🙌 2
y
@Kevin Grismore Nice 👍 Thanks,
s
We include this parameter when calling Deployment.build_from_flow:
is_schedule_active=config.get("ENVIRONMENT", "").lower() == "production",