From 3750f53b911f55b6fa1df594ecf42e9ccbbd4319 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Thu, 4 Jul 2024 15:57:24 -0600 Subject: [PATCH] Observe --force-rebuild --- .../deploy/webapp/deploy_webapp_from_registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py b/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py index 9edd2139..7ca716ab 100644 --- a/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py +++ b/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py @@ -117,8 +117,11 @@ def process_app_deployment_request( shutil.copyfile(env_filename, deployment_config_file) needs_k8s_deploy = False + if force_rebuild: + logger.log("--force-rebuild is enabled so the container will always be built now, even if nothing has changed in the app") # 6. build container (if needed) - if not deployment_record or deployment_record.attributes.application != app.id: + # TODO: add a comment that explains what this code is doing (not clear to me) + if not deployment_record or deployment_record.attributes.application != app.id or force_rebuild: needs_k8s_deploy = True # check if the image already exists shared_tag_exists = remote_image_exists(image_registry, app_image_shared_tag)