Update image tag for subsequent deployments of same app

This commit is contained in:
Prathamesh Musale 2025-02-05 19:18:49 +05:30
parent cdd431d8a5
commit ef6f5db743
2 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,7 @@ from stack_orchestrator.deploy.deploy import create_deploy_context
from stack_orchestrator.deploy.deploy_types import DeployCommandContext
def _fixup_container_tag(deployment_dir: str, image: str):
def fixup_container_tag(deployment_dir: str, image: str):
deployment_dir_path = Path(deployment_dir)
compose_file = deployment_dir_path.joinpath("compose", "docker-compose-webapp-template.yml")
# replace "cerc/webapp-container:local" in the file with our image tag
@ -109,7 +109,7 @@ def create_deployment(ctx, deployment_dir, image, urls, kube_config, image_regis
None
)
# Fix up the container tag inside the deployment compose file
_fixup_container_tag(deployment_dir, image)
fixup_container_tag(deployment_dir, image)
os.remove(spec_file_name)

View File

@ -211,11 +211,10 @@ def process_app_deployment_request(
# Update existing deployment spec with new urls
deploy_webapp.fixup_url_spec(os.path.join(deployment_dir, constants.spec_file_name))
# TODO: Update with deployment_container_tag if it's not a redeployment
# as for redeployment, deployment_container_tag won't get built
# if deployment_record.attributes.application != app.id:
# ...
# Update the image name deployment_container_tag
# Skip for redeployment as deployment_container_tag won't get built
if deployment_record.attributes.application != app.id:
deploy_webapp.fixup_container_tag(deployment_dir, deployment_container_tag)
needs_k8s_deploy = False
if force_rebuild: