run dockerfile if exists
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 37s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m16s
Smoke Test / Run basic test suite (pull_request) Successful in 5m6s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m47s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 12m26s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 14m54s

This commit is contained in:
VPhung24 2024-10-07 18:27:10 +00:00
parent f1fdc48aaa
commit bca332b598

View File

@ -88,9 +88,17 @@ def command(ctx, base_container, source_repo, force_rebuild, extra_build_args, t
# Now build the target webapp. We use the same build script, but with a different Dockerfile and work dir. # Now build the target webapp. We use the same build script, but with a different Dockerfile and work dir.
container_build_env["CERC_WEBAPP_BUILD_RUNNING"] = "true" container_build_env["CERC_WEBAPP_BUILD_RUNNING"] = "true"
container_build_env["CERC_CONTAINER_BUILD_WORK_DIR"] = os.path.abspath(source_repo) container_build_env["CERC_CONTAINER_BUILD_WORK_DIR"] = os.path.abspath(source_repo)
container_build_env["CERC_CONTAINER_BUILD_DOCKERFILE"] = os.path.join(container_build_dir, # Check if Dockerfile exists in the repository
repo_dockerfile = os.path.join(container_build_env["CERC_CONTAINER_BUILD_WORK_DIR"], "Dockerfile")
default_dockerfile = os.path.join(container_build_dir,
base_container.replace("/", "-"), base_container.replace("/", "-"),
"Dockerfile.webapp") "Dockerfile.webapp")
if os.path.isfile(repo_dockerfile):
container_build_env["CERC_CONTAINER_BUILD_DOCKERFILE"] = repo_dockerfile
else:
container_build_env["CERC_CONTAINER_BUILD_DOCKERFILE"] = default_dockerfile
if not tag: if not tag:
webapp_name = os.path.abspath(source_repo).split(os.path.sep)[-1] webapp_name = os.path.abspath(source_repo).split(os.path.sep)[-1]
tag = f"cerc/{webapp_name}:local" tag = f"cerc/{webapp_name}:local"