2023-09-10 19:28:26 +00:00
|
|
|
# Copyright © 2022, 2023 Vulcanize
|
2022-08-23 17:32:55 +00:00
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
|
|
|
|
2022-08-24 03:27:42 +00:00
|
|
|
import click
|
|
|
|
|
2023-11-07 07:06:55 +00:00
|
|
|
from stack_orchestrator.command_types import CommandOptions
|
|
|
|
from stack_orchestrator.repos import setup_repositories
|
2024-04-18 21:22:47 +00:00
|
|
|
from stack_orchestrator.repos import fetch_stack
|
2024-02-27 15:15:08 +00:00
|
|
|
from stack_orchestrator.build import build_containers, fetch_containers
|
2023-11-07 07:06:55 +00:00
|
|
|
from stack_orchestrator.build import build_npms
|
2023-11-08 00:15:04 +00:00
|
|
|
from stack_orchestrator.build import build_webapp
|
2023-12-22 00:05:40 +00:00
|
|
|
from stack_orchestrator.deploy.webapp import (run_webapp,
|
|
|
|
deploy_webapp,
|
|
|
|
deploy_webapp_from_registry,
|
2024-08-27 19:55:06 +00:00
|
|
|
undeploy_webapp_from_registry,
|
|
|
|
publish_webapp_deployer,
|
2024-09-26 13:31:41 +00:00
|
|
|
publish_deployment_auction,
|
2024-10-01 09:17:11 +00:00
|
|
|
handle_deployment_auction,
|
2024-08-27 19:55:06 +00:00
|
|
|
request_webapp_deployment)
|
2023-11-07 07:06:55 +00:00
|
|
|
from stack_orchestrator.deploy import deploy
|
|
|
|
from stack_orchestrator import version
|
|
|
|
from stack_orchestrator.deploy import deployment
|
|
|
|
from stack_orchestrator import opts
|
|
|
|
from stack_orchestrator import update
|
2022-08-24 03:27:42 +00:00
|
|
|
|
2022-08-24 17:57:35 +00:00
|
|
|
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
2022-08-24 03:27:42 +00:00
|
|
|
|
2022-10-04 01:37:18 +00:00
|
|
|
|
2022-08-24 17:57:35 +00:00
|
|
|
@click.group(context_settings=CONTEXT_SETTINGS)
|
2023-01-17 23:05:50 +00:00
|
|
|
@click.option('--stack', help="specify a stack to build/deploy")
|
2022-08-24 19:01:35 +00:00
|
|
|
@click.option('--quiet', is_flag=True, default=False)
|
|
|
|
@click.option('--verbose', is_flag=True, default=False)
|
|
|
|
@click.option('--dry-run', is_flag=True, default=False)
|
2022-10-06 13:18:29 +00:00
|
|
|
@click.option('--local-stack', is_flag=True, default=False)
|
2023-01-06 17:20:18 +00:00
|
|
|
@click.option('--debug', is_flag=True, default=False)
|
2023-01-19 20:20:53 +00:00
|
|
|
@click.option('--continue-on-error', is_flag=True, default=False)
|
2022-08-24 18:29:51 +00:00
|
|
|
# See: https://click.palletsprojects.com/en/8.1.x/complex/#building-a-git-clone
|
|
|
|
@click.pass_context
|
2023-01-19 20:20:53 +00:00
|
|
|
def cli(ctx, stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error):
|
2022-08-24 18:29:51 +00:00
|
|
|
"""Laconic Stack Orchestrator"""
|
2023-10-27 16:19:44 +00:00
|
|
|
command_options = CommandOptions(stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error)
|
|
|
|
opts.opts.o = command_options
|
|
|
|
ctx.obj = command_options
|
2022-08-24 17:57:35 +00:00
|
|
|
|
2022-10-04 01:37:18 +00:00
|
|
|
|
2024-04-18 21:22:47 +00:00
|
|
|
cli.add_command(fetch_stack.command, "fetch-stack")
|
2022-10-04 01:37:18 +00:00
|
|
|
cli.add_command(setup_repositories.command, "setup-repositories")
|
|
|
|
cli.add_command(build_containers.command, "build-containers")
|
2024-02-27 15:15:08 +00:00
|
|
|
cli.add_command(fetch_containers.command, "fetch-containers")
|
2023-01-04 23:16:40 +00:00
|
|
|
cli.add_command(build_npms.command, "build-npms")
|
2023-11-08 00:15:04 +00:00
|
|
|
cli.add_command(build_webapp.command, "build-webapp")
|
2023-11-15 17:54:27 +00:00
|
|
|
cli.add_command(run_webapp.command, "run-webapp")
|
2023-11-28 05:02:16 +00:00
|
|
|
cli.add_command(deploy_webapp.command, "deploy-webapp")
|
2023-12-14 03:02:34 +00:00
|
|
|
cli.add_command(deploy_webapp_from_registry.command, "deploy-webapp-from-registry")
|
2023-12-22 00:05:40 +00:00
|
|
|
cli.add_command(undeploy_webapp_from_registry.command, "undeploy-webapp-from-registry")
|
2024-08-27 19:55:06 +00:00
|
|
|
cli.add_command(publish_webapp_deployer.command, "publish-deployer-to-registry")
|
2024-09-26 13:31:41 +00:00
|
|
|
cli.add_command(publish_deployment_auction.command, "publish-deployment-auction")
|
2024-10-01 09:17:11 +00:00
|
|
|
cli.add_command(handle_deployment_auction.command, "handle-deployment-auction")
|
2024-08-27 19:55:06 +00:00
|
|
|
cli.add_command(request_webapp_deployment.command, "request-webapp-deployment")
|
2023-06-27 22:58:41 +00:00
|
|
|
cli.add_command(deploy.command, "deploy") # deploy is an alias for deploy-system
|
|
|
|
cli.add_command(deploy.command, "deploy-system")
|
|
|
|
cli.add_command(deployment.command, "deployment")
|
2023-01-10 21:09:38 +00:00
|
|
|
cli.add_command(version.command, "version")
|
2023-09-27 20:24:41 +00:00
|
|
|
cli.add_command(update.command, "update")
|