Lana Dann
12/01/2021, 7:37 PMflows
directory that registers the same flows in different runtime environments, but some flows I only want to run in staging
and not in production
, for example. I register all staging flows using:
prefect register -p lib/flows/ --project {project} --label staging
Kevin Kho
12/01/2021, 7:50 PMpython
file? I don’t think there is a way. The only thing I can think of here would be to split up the flows into different folders inside that flow
folder so that you can register one folder at a timeLana Dann
12/01/2021, 7:56 PMif os.environ.get("ENVIRONMENT") == "staging":
with Flow(...) as flow:
do_things()
but then it doesn’t register at all 😞Bruno Kuasney
12/02/2021, 8:10 AMclient.delete_project(project_id)
)
example:
if os.environ.get("ENVIRONMENT") == "staging":
for project_name in stage_project:
query = "query {flow(where:{project: {name: {_eq: %s}}, archived: {_eq: false}}) {id}}" % project_name
result = client.graphql(query)
project_id = '"' + result['data']['flow'][0]['id'] + '"'
# pause flow
query = "mutation {set_schedule_inactive(input: {flow_id: %s}) {success}}" % project_id
client.graphql(query)
or sth like that, I don’t know if would work when deployed tho