Add run-webapp command.

This commit is contained in:
Thomas E Lackey 2023-11-15 01:39:56 -06:00
parent 638fa01649
commit 5407961613
4 changed files with 7 additions and 4 deletions

View File

@ -61,9 +61,10 @@ class DockerDeployer(Deployer):
except DockerException as e: except DockerException as e:
raise DeployerException(e) raise DeployerException(e)
def run(self, image, command, user, volumes, entrypoint=None): def run(self, image: str, command=None, user=None, volumes=None, entrypoint=None, env={}, detach=False):
try: try:
return self.docker.run(image=image, command=command, user=user, volumes=volumes, entrypoint=entrypoint) return self.docker.run(image=image, command=command, user=user, volumes=volumes,
entrypoint=entrypoint, envs=env, detach=detach, publish_all=True)
except DockerException as e: except DockerException as e:
raise DeployerException(e) raise DeployerException(e)

View File

@ -44,7 +44,7 @@ class Deployer(ABC):
pass pass
@abstractmethod @abstractmethod
def run(self, image, command, user, volumes, entrypoint): def run(self, image: str, command=None, user=None, volumes=None, entrypoint=None, env={}, detach=False):
pass pass

View File

@ -120,7 +120,7 @@ class K8sDeployer(Deployer):
log_data = self.core_api.read_namespaced_pod_log(k8s_pod_name, namespace="default", container="test") log_data = self.core_api.read_namespaced_pod_log(k8s_pod_name, namespace="default", container="test")
return log_stream_from_string(log_data) return log_stream_from_string(log_data)
def run(self, image, command, user, volumes, entrypoint=None): def run(self, image: str, command=None, user=None, volumes=None, entrypoint=None, env={}, detach=False):
# We need to figure out how to do this -- check why we're being called first # We need to figure out how to do this -- check why we're being called first
pass pass

View File

@ -20,6 +20,7 @@ from stack_orchestrator.repos import setup_repositories
from stack_orchestrator.build import build_containers from stack_orchestrator.build import build_containers
from stack_orchestrator.build import build_npms from stack_orchestrator.build import build_npms
from stack_orchestrator.build import build_webapp from stack_orchestrator.build import build_webapp
from stack_orchestrator.deploy import run_webapp
from stack_orchestrator.deploy import deploy from stack_orchestrator.deploy import deploy
from stack_orchestrator import version from stack_orchestrator import version
from stack_orchestrator.deploy import deployment from stack_orchestrator.deploy import deployment
@ -50,6 +51,7 @@ cli.add_command(setup_repositories.command, "setup-repositories")
cli.add_command(build_containers.command, "build-containers") cli.add_command(build_containers.command, "build-containers")
cli.add_command(build_npms.command, "build-npms") cli.add_command(build_npms.command, "build-npms")
cli.add_command(build_webapp.command, "build-webapp") cli.add_command(build_webapp.command, "build-webapp")
cli.add_command(run_webapp.command, "run-webapp")
cli.add_command(deploy.command, "deploy") # deploy is an alias for deploy-system cli.add_command(deploy.command, "deploy") # deploy is an alias for deploy-system
cli.add_command(deploy.command, "deploy-system") cli.add_command(deploy.command, "deploy-system")
cli.add_command(deployment.command, "deployment") cli.add_command(deployment.command, "deployment")