Skip to content

Commit

Permalink
update service version on create package
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Oct 10, 2024
1 parent 2c37e52 commit 7a71a7e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,28 @@ def update_client_version(logger):
stream.write(VERSION_PY_CONTENT)


def update_service_version(logger):
docker_compose_path = os.path.join(
CURRENT_ROOT, "service", "docker-compose.yml"
)
with open(docker_compose_path, "r") as stream:
content = stream.readlines()

new_lines = []
sep = "image: ynput/ayon-syncsketch-processor"
for line in content:
if sep in line:
head, _ = line.split(sep)
new_line = f"{head}{sep}:{ADDON_VERSION}\n"
if new_line != line:
logger.info(f"Updating service version to {ADDON_VERSION}")

new_lines.append(line)

with open(docker_compose_path, "w") as stream:
stream.write("".join(new_lines))


def build_frontend():
yarn_executable = _get_yarn_executable()
if yarn_executable is None:
Expand Down Expand Up @@ -430,6 +452,8 @@ def main(
)
update_client_version(log)

update_service_version(log)

if only_client:
if not has_client_code:
raise RuntimeError("Client code is not available. Skipping")
Expand Down
2 changes: 1 addition & 1 deletion service/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: ayon-syncsketch-services
services:
processor:
container_name: processor
image: ynput/ayon-syncsketch-processor:0.1.1
image: ynput/ayon-syncsketch-processor:0.1.2-dev.1
restart: unless-stopped
env_file: .env

0 comments on commit 7a71a7e

Please sign in to comment.