Skip to content

Commit

Permalink
fix update-flow for LOCAL_BUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Jan 16, 2025
1 parent 5e7e2c0 commit 0b0748a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions wis2box-ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ def get_latest_release_tag(image: str, resolved_version: str = '') -> str:

# look up the image tag for the release by downloading the wis2box-images.json file
# NOTE using maaikelimper/wis2box-images for demo purposes, should be wmo-im/wis2box-images
url = f'https://github.com/maaikelimper/wis2box-images/releases/download/{resolved_version}/wis2box-images.json'
github_repo = 'maaikelimper/wis2box-images'

url = f'https://github.com/{github_repo}/releases/download/{resolved_version}/wis2box-images.json'
if resolved_version == 'LOCAL_BUILD':
# use the version of images in main branch
url = f'https://raw.githubusercontent.com/{github_repo}/refs/heads/main/wis2box-images.json'
try:
response = requests.get(url)
if response.status_code == 200:
Expand Down Expand Up @@ -222,10 +227,10 @@ def update_docker_images(base_version: str) -> None:
for line in lines:
if 'image: ' in line:
image = line.split('image: ')[1].split(':')[0]
tag = 'latest'
tag = ''
if image in LOCAL_IMAGES and base_version == 'LOCAL_BUILD':
tag = 'local'
elif base_version != 'LOCAL_BUILD':
else:
tag = get_latest_release_tag(image, resolved_version)
# pull the image if it is not local
if tag != 'local':
Expand Down

0 comments on commit 0b0748a

Please sign in to comment.