Skip to content

Commit

Permalink
Upgrade baseline when running on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Dec 18, 2024
1 parent 3c4a84a commit 6990c5a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .nextmv/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ def push_new_version(app: cloud.Application, tag: str) -> None:
)


def upgrade_baseline(app: cloud.Application, version_id: str) -> None:
"""
Upgrade the baseline instance to use the new version.
"""
instance = app.instance("baseline")
app.update_instance(
id="baseline",
version_id=version_id,
name=instance.name, # Name is required, but we don't want to change it
)


def run_acceptance_test(
app: cloud.Application,
id: str,
Expand Down Expand Up @@ -194,6 +206,10 @@ def main():
for metric in result.results.metric_results:
write_to_summary(f"- {metric.metric.field}: {metric.passed}")

if BRANCH_NAME == "develop":
print("Upgrading baseline instance to use the new version...")
upgrade_baseline(app, tag)

print("Done")


Expand Down

0 comments on commit 6990c5a

Please sign in to comment.