From c18f1f1f24afa5931eb36dd2a9d61ec49c0673f0 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Wed, 29 Nov 2023 19:41:48 -0700 Subject: [PATCH 1/2] Add doc for deploy-webapp --- docs/webapp.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/webapp.md b/docs/webapp.md index 3b1d0609..fcf4ffcb 100644 --- a/docs/webapp.md +++ b/docs/webapp.md @@ -34,7 +34,7 @@ To test locally run: ## Running -With `run-webapp` a new container will be launched with runtime configuration provided by `--env-file` (if specified) and published on an available port. Multiple instances can be launched with different configuration. +With `run-webapp` a new container will be launched on the local machine, with runtime configuration provided by `--env-file` (if specified) and published on an available port. Multiple instances can be launched with different configuration. **Example**: ``` @@ -52,3 +52,13 @@ Image: cerc/test-progressive-web-app:local ID: 9ab96494f563aafb6c057d88df58f9eca81b90f8721a4e068493a289a976051c URL: http://localhost:32769 ``` + +## Deploying + +Use the subcommand `deploy-webapp create` to make a deployment directory that can be subsequently deployed to a Kubernetes cluster. +Example commands are shown below, assuming that the webapp container image `cerc/test-progressive-web-app:local` has already been built: +``` +$ laconic-so deploy-webapp create --kube-config ~/kubectl/k8s-kubeconfig.yaml --image-registry registry.digitalocean.com/laconic-registry --deployment-dir webapp-k8s-deployment --image cerc/test-progressive-web-app:local --url https://test-pwa-app.hosting.laconic.com/ --env-file test-webapp.env +$ laconic-so deployment --dir webapp-k8s-deployment push-images +$ laconic-so deployment --dir webapp-k8s-deployment start +``` -- 2.45.2 From d7093277b4743b7eb0d533bf6c6d0327d696f762 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Wed, 29 Nov 2023 20:50:53 -0700 Subject: [PATCH 2/2] Use constants (#671) --- stack_orchestrator/deploy/deployment_context.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stack_orchestrator/deploy/deployment_context.py b/stack_orchestrator/deploy/deployment_context.py index cd731394..cbee4151 100644 --- a/stack_orchestrator/deploy/deployment_context.py +++ b/stack_orchestrator/deploy/deployment_context.py @@ -16,6 +16,7 @@ from pathlib import Path +from stack_orchestrator import constants from stack_orchestrator.deploy.stack import Stack from stack_orchestrator.deploy.spec import Spec @@ -26,13 +27,13 @@ class DeploymentContext: stack: Stack def get_stack_file(self): - return self.deployment_dir.joinpath("stack.yml") + return self.deployment_dir.joinpath(constants.stack_file_name) def get_spec_file(self): - return self.deployment_dir.joinpath("spec.yml") + return self.deployment_dir.joinpath(constants.spec_file_name) def get_env_file(self): - return self.deployment_dir.joinpath("config.env") + return self.deployment_dir.joinpath(constants.config_file_name) # TODO: implement me def get_cluster_name(self): -- 2.45.2