BTHLABS-0000: bump-version task

Enough with manual version bumps :D
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl>
Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
2025-09-17 18:26:06 +00:00
parent 0ab87e25a4
commit 80fbbcddf3
17 changed files with 766 additions and 22 deletions

View File

@@ -7,6 +7,9 @@ import datetime
from invoke import Context, task
from hotpocket_workspace_tools import get_workspace_mode, WorkspaceMode
from hotpocket_workspace_tools.tasks import (
bump_version as tools_bump_version_task,
)
class DockerBuildContext:
@@ -61,7 +64,8 @@ class DockerBuildContext:
WORKSPACE_MODE = get_workspace_mode()
ALL_SERVICES = ['backend', 'packages', 'extension']
ALL_SERVICES = ['apple', 'backend', 'extension', 'packages']
VERSIONED_SERVICES = ['apple', 'backend', 'extension']
def _run_in_service(ctx: Context, service, command, **kwargs):
@@ -265,3 +269,17 @@ def start_celery_beat(ctx: Context, service):
@task
def start_app(ctx: Context, service, app):
_run_in_service(ctx, service, f'inv start-{app}')
@task
def bump_version(ctx: Context, next_version: str, build: str | None = None):
assert build is not None, '`--build` is required here'
tools_bump_version_task(ctx, next_version, build=build)
for service_to_setup in VERSIONED_SERVICES:
_run_in_service(
ctx,
service_to_setup,
f'inv bump-version {next_version} --build {build}',
)