Deployments feature #433

Merged
telackey merged 16 commits from dboreham/deployments into main 2023-06-27 22:58:41 +00:00
3 changed files with 66 additions and 21 deletions
Showing only changes of commit 75da296222 - Show all commits

64
app/deployment.py Normal file
View File

@ -0,0 +1,64 @@
# Copyright © 2022, 2023 Cerc
# 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/>.
import click
import sys
@click.group()
@click.option("--dir", required=True, help="path to deployment directory")
@click.pass_context
def command(ctx):
print(f"Context: {ctx.parent.obj}")
# Check that --stack wasn't supplied
if ctx.parent.obj.stack:
print("Error: --stack can't be supplied with the deployment command")
sys.exit(1)
@command.command()
@click.pass_context
def up(ctx):
print(f"Context: {ctx.parent.obj}")
@command.command()
@click.pass_context
def down(ctx):
print(f"Context: {ctx.parent.obj}")
@command.command()
@click.pass_context
def ps(ctx):
print(f"Context: {ctx.parent.obj}")
@command.command()
@click.pass_context
def logs(ctx):
print(f"Context: {ctx.parent.obj}")
@command.command()
@click.pass_context
def task(ctx):
print(f"Context: {ctx.parent.obj}")
@command.command()
@click.pass_context
def status(ctx):
print(f"Context: {ctx.parent.obj}")

View File

@ -1,21 +0,0 @@
# Copyright © 2022, 2023 Cerc
# 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/>.
import click
@click.command()
def init():
pass

2
cli.py
View File

@ -21,6 +21,7 @@ from app import build_containers
from app import build_npms
from app import deploy
from app import version
from app import deployment
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@ -56,4 +57,5 @@ cli.add_command(build_containers.command, "build-containers")
cli.add_command(build_npms.command, "build-npms")
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")
cli.add_command(version.command, "version")