Beginnings of click support

This commit is contained in:
David Boreham 2022-08-23 21:27:42 -06:00
parent 8e75a1cedb
commit fbf9d17a64
4 changed files with 124 additions and 102 deletions

View File

@ -25,6 +25,7 @@ import sys
import argparse
from decouple import config
import subprocess
import click
parser = argparse.ArgumentParser(
description="build the set of containers required for a complete stack",
@ -37,6 +38,8 @@ parser.add_argument("--dry-run", action="store_true", help="don\'t do anything,
args = parser.parse_args()
@click.command()
def command():
verbose = args.verbose
quiet = args.quiet

View File

@ -19,6 +19,7 @@ import os
import argparse
from decouple import config
from python_on_whales import DockerClient
import click
def include_exclude_check(s, args):
if args.include == None and args.exclude == None:
@ -47,7 +48,8 @@ args = parser.parse_args()
verbose = args.verbose
quiet = args.quiet
print(args)
@click.command()
def command():
with open("cluster-list.txt") as cluster_list_file:
clusters = cluster_list_file.read().splitlines()

View File

@ -22,6 +22,7 @@ import argparse
from decouple import config
import git
from tqdm import tqdm
import click
class GitProgress(git.RemoteProgress):
def __init__(self):
@ -52,6 +53,9 @@ parser.add_argument("--pull", action="store_true", help="pull from remote in alr
args = parser.parse_args()
@click.command()
def command():
verbose = args.verbose
quiet = args.quiet

View File

@ -13,3 +13,16 @@
# 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
from .app import setup_repositories
from .app import build_containers
from .app import deploy_system
@click.group()
def main_command_group():
pass
main_command_group.add_command(setup_repositories.command)
main_command_group.add_command(build_containers.command)
main_command_group.add_command(deploy_system.command)