Initial implementation of stack

This commit is contained in:
2023-01-17 16:05:50 -07:00
parent 65f5382bfe
commit 1d7128c6e1
3 changed files with 19 additions and 3 deletions
+11
View File
@@ -23,6 +23,7 @@ import git
from tqdm import tqdm
import click
import importlib.resources
import yaml
from .util import include_exclude_check
@@ -64,9 +65,11 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file):
quiet = ctx.obj.quiet
verbose = ctx.obj.verbose
dry_run = ctx.obj.dry_run
stack = ctx.obj.stack
branches = []
# TODO: branches file needs to be re-worked in the context of stacks
if branches_file:
if verbose:
print(f"loading branches from: {branches_file}")
@@ -96,8 +99,16 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file):
with importlib.resources.open_text(data, "repository-list.txt") as repository_list_file:
all_repos = repository_list_file.read().splitlines()
if stack:
resource_data_dir = importlib.resources.files(data)
with importlib.resources.as_file(resource_data_dir.joinpath(f"stacks/{stack}/stack.yml")) as stack_file_path:
stack_config = yaml.safe_load(open(stack_file_path, "r"))
print(f"stack is: {stack_config}")
if verbose:
print(f"Repos: {all_repos}")
if stack:
print(f"Stack: {stack}")
repos = []
for repo in all_repos: