Build a CLI container

This commit is contained in:
dboreham committed 2023-01-06 15:57:14 -07:00
1 parent 318d70020e
commit 82755a27f2
7 files changed
+15 -10

No files matched your search

+4 -3
View File
@@ -66,8 +66,9 @@ def command(ctx, include, exclude):
# TODO: make this configurable
container_build_env = {
"CERC_NPM_URL": "http://host.docker.internal:3000/api/packages/cerc-io/npm/",
"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"]
"CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/",
"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"],
"CERC_REPO_BASE_DIR": dev_root_path
}
def process_container(container):
@@ -91,7 +92,7 @@ def command(ctx, include, exclude):
if not dry_run:
if verbose:
print(f"Executing: {build_command}")
build_result = subprocess.run(build_command, shell=True, env={'CERC_REPO_BASE_DIR': dev_root_path})
build_result = subprocess.run(build_command, shell=True, env=container_build_env)
# TODO: check result in build_result.returncode
print(f"Result is: {build_result}")
else:
+2 -2
View File
@@ -62,7 +62,7 @@ def command(ctx, include, exclude):
repo_dir = package
repo_full_path = os.path.join(dev_root_path, repo_dir)
# TODO: make the npm registry url configurable.
build_command = ["sh", "-c", "cd /workspace && build-npm-package-local-dependencies.sh http://host.docker.internal:3000/api/packages/cerc-io/npm/"]
build_command = ["sh", "-c", "cd /workspace && build-npm-package-local-dependencies.sh http://gitea.local:3000/api/packages/cerc-io/npm/"]
if not dry_run:
if verbose:
print(f"Executing: {build_command}")
@@ -73,7 +73,7 @@ def command(ctx, include, exclude):
tty=True,
user=f"{os.getuid()}:{os.getgid()}",
envs=envs,
add_hosts=[("host.docker.internal", "host-gateway")],
add_hosts=[("gitea.local", "host-gateway")],
volumes=[(repo_full_path, "/workspace")],
command=build_command
)