Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions dev/breeze/src/airflow_breeze/commands/workflow_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ def workflow_run_publish(
**workflow_fields,
)

if site_env == "auto":
pattern = re.compile(r"^.*[0-9]+\.[0-9]+\.[0-9]+$")
if pattern.match(ref):
site_env = "live"
else:
site_env = "staging"

branch = "main" if site_env == "live" else "staging"

if refresh_site:
get_console().print(
f"[blue]Refreshing site at {APACHE_AIRFLOW_SITE_REPO}[/blue]",
)
wf_name = WORKFLOW_NAME_MAPS["airflow-refresh-site"]

if site_env == "auto":
pattern = re.compile(r"^.*[0-9]+\.[0-9]+\.[0-9]+$")
if pattern.match(ref):
site_env = "live"
else:
site_env = "staging"

branch = "main" if site_env == "live" else "staging"

get_console().print(
f"[blue]Triggering workflow {wf_name}: at {APACHE_AIRFLOW_SITE_REPO}[/blue]",
)
Expand All @@ -159,6 +159,7 @@ def workflow_run_publish(
trigger_workflow_and_monitor(
workflow_name=WORKFLOW_NAME_MAPS["sync-s3-to-github"],
repo=APACHE_AIRFLOW_SITE_ARCHIVE_REPO,
branch=branch,
**workflow_fields,
monitor=False,
)
4 changes: 4 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/gh_workflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def tigger_workflow(workflow_name: str, repo: str, branch: str = "main", **kwarg

# These are the input parameters to workflow
for key, value in kwargs.items():
# GH cli requires bool inputs to be converted to string format
if isinstance(value, bool):
value = "true" if value else "false"

command.extend(["-f", f"{key}={value}"])

get_console().print(f"[blue]Running command: {' '.join(command)}[/blue]")
Expand Down