Compare commits

..

8 Commits

Author SHA1 Message Date
a1b82cc71c Merge branch 'deploy-create-pass-cluster' into vaasl-deploy
All checks were successful
Lint Checks / Run linter (push) Successful in 3m14s
2025-11-03 17:26:07 +08:00
bd5b806ae3 Merge branch 'build-forward-vars' into vaasl-deploy
All checks were successful
Lint Checks / Run linter (push) Successful in 7m41s
2025-10-28 14:55:10 +08:00
58e645dcfe forward some env vars to build command 2025-10-28 14:54:46 +08:00
27ee95d0ff test stack does not need laconicd
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 13m27s
Deploy Test / Run deploy test suite (pull_request) Successful in 18m17s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 22m7s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 20m36s
Webapp Test / Run webapp test suite (pull_request) Successful in 20m25s
Smoke Test / Run basic test suite (pull_request) Successful in 19m33s
2025-10-19 14:36:49 +08:00
0aca6d0938 patch 2025-10-19 14:36:44 +08:00
b1a489ef1b Add DeploymentContext.modify_yaml helper
Some checks failed
Lint Checks / Run linter (pull_request) Successful in 3m37s
Deploy Test / Run deploy test suite (pull_request) Failing after 7m29s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 8m48s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Failing after 11m22s
Webapp Test / Run webapp test suite (pull_request) Successful in 14m39s
Smoke Test / Run basic test suite (pull_request) Successful in 17m17s
For custom deploy commands
2025-10-19 13:59:08 +08:00
8f92e2700c Pass extra args to custom create command 2025-10-19 02:08:19 +08:00
05c8765d6d Pass --cluster option to deploy create
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 38s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m3s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 7m34s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 5m46s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m6s
Smoke Test / Run basic test suite (pull_request) Successful in 4m4s
2024-11-09 19:52:11 +08:00
2 changed files with 15 additions and 11 deletions

View File

@ -26,6 +26,7 @@ from decouple import config
import subprocess
import click
from pathlib import Path
from typing import Any
from stack_orchestrator.opts import opts
from stack_orchestrator.util import include_exclude_check, stack_is_external, error_exit
from stack_orchestrator.base import get_npm_registry_url
@ -42,7 +43,7 @@ def make_container_build_env(dev_root_path: str,
debug: bool,
force_rebuild: bool,
extra_build_args: str):
container_build_env = {
command_env: dict[str, Any] = {
"CERC_NPM_REGISTRY_URL": get_npm_registry_url(),
"CERC_GO_AUTH_TOKEN": config("CERC_GO_AUTH_TOKEN", default=""),
"CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default=""),
@ -52,14 +53,16 @@ def make_container_build_env(dev_root_path: str,
"CERC_HOST_GID": f"{os.getgid()}",
"DOCKER_BUILDKIT": config("DOCKER_BUILDKIT", default="0")
}
container_build_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
container_build_env.update({"CERC_FORCE_REBUILD": "true"} if force_rebuild else {})
container_build_env.update({"CERC_CONTAINER_EXTRA_BUILD_ARGS": extra_build_args} if extra_build_args else {})
docker_host_env = os.getenv("DOCKER_HOST")
if docker_host_env:
container_build_env.update({"DOCKER_HOST": docker_host_env})
command_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
command_env.update({"CERC_FORCE_REBUILD": "true"} if force_rebuild else {})
command_env.update({"CERC_CONTAINER_EXTRA_BUILD_ARGS": extra_build_args} if extra_build_args else {})
return container_build_env
forwarded_vars = ("DOCKER_HOST", "BUILDKIT_PROGRESS", "http_proxy", "https_proxy")
for var in forwarded_vars:
if value := config(var, default=None):
command_env[var] = value
return command_env
def process_container(build_context: BuildContext) -> bool:

View File

@ -422,9 +422,10 @@ def _copy_files_to_directory(file_paths: List[Path], directory: Path):
copy(path, os.path.join(directory, os.path.basename(path)))
def _create_deployment_file(deployment_dir: Path):
def _create_deployment_file(deployment_dir: Path, cluster):
deployment_file_path = deployment_dir.joinpath(constants.deployment_file_name)
cluster = f"{constants.cluster_name_prefix}{token_hex(8)}"
if cluster is None:
cluster = f"{constants.cluster_name_prefix}{token_hex(8)}"
with open(deployment_file_path, "w") as output_file:
output_file.write(f"{constants.cluster_id_key}: {cluster}\n")
@ -471,7 +472,7 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, extr
# Copy spec file and the stack file into the deployment dir
copyfile(spec_file, deployment_dir_path.joinpath(constants.spec_file_name))
copyfile(stack_file, deployment_dir_path.joinpath(constants.stack_file_name))
_create_deployment_file(deployment_dir_path)
_create_deployment_file(deployment_dir_path, deployment_command_context.cluster_context.cluster)
# Copy any config varibles from the spec file into an env file suitable for compose
_write_config_file(spec_file, deployment_dir_path.joinpath(constants.config_file_name))
# Copy any k8s config file into the deployment dir