PK!(~ffclouduct/__init__.pyfrom clouduct.clouduct import generate # noqa: F401 from clouduct.reseed import reseed # noqa: F401 PK!T::clouduct/clouduct.py#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """.""" import git import os import clouduct.reseed def generate(project_name, profile, template, tags, env, execute=False): """Generate a new project in AWS.""" print("CURDIR1:", os.path.realpath(os.path.curdir)) print("cloning {}".format(template["application"])) git.Repo.clone_from(template["application"], ".clouduct-seed", depth=1) clouduct.reseed(".clouduct-seed", input={"project_name": project_name}) print("CURDIR2:", os.path.realpath(os.path.curdir)) git.Repo.clone_from(template["infrastructure"], "{}-infra".format(project_name), depth=1) # clouduct_tf = os.path.join(os.path.dirname( # os.path.dirname( # os.path.dirname(os.path.realpath(__file__)))), "clouduct-bin/clouduct-tf") if execute: # execute terraform pass else: # terraform plan pass PK!AAclouduct/console/__init__.pyfrom .clouductbootstrap import create def main(): create() PK!e(CC%clouduct/console/clouductbootstrap.py#!/usr/bin/env python """Command Line Interface for 'clouduct'.""" import os import sys import urllib.request import boto3 import click import click_completion import yaml import clouduct def click_completion_match_incomplete(choice, incomplete): return incomplete in choice click_completion.init(match_incomplete=click_completion_match_incomplete, complete_options=True) profiles = boto3.session.Session().available_profiles DEFAULT_TEMPLATES_CONFIG = \ "https://raw.githubusercontent.com/clouduct/clouduct-bootstrap/master/clouduct-templates.yaml" # print(default_template_names) environments = ["dev", "test", "prod"] def template_names(): argx = sys.argv # command line completion COMMANDLINE = os.environ.get("COMMANDLINE") if COMMANDLINE: # zsh only argx = COMMANDLINE.split(" ") COMP_WORDS = os.environ.get("COMP_WORDS") if COMP_WORDS: # bash only argx = COMP_WORDS.split("\t") try: tmpix = argx.index("--templates-config") templates_config = argx[tmpix + 1] except ValueError: templates_config = DEFAULT_TEMPLATES_CONFIG try: templates_config = templates_config.strip('\'"') with urllib.request.urlopen(templates_config) as resource: templates = yaml.load(resource) return list(templates.keys()) # TODO: Caching except ValueError as err: click.echo("HERE", file=sys.stderr, err=True) click.echo(err, file=sys.stderr, err=True) sys.exit(1) except Exception as err: click.echo(err, file=sys.stderr, err=True) sys.exit(1) @click.group(help) def completion(): """Needed for click_completion.""" pass @completion.command() # @click.option('--execute', is_flag=True, # help='clouduct will only show the execution plan unless you give this flag') @click.option('--profile', type=click.Choice(profiles), help='One of your locally configured AWS profiles (see' ' https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html)') @click.option('--template', "template_key", type=click.Choice(template_names()), help='The template your new project will be based on' ' (see https://clouduct.org/templates.html)') @click.option('--templates-config', help='A URL where that returns a list of templates (either as text or as application/json)') @click.option('--tag', 'tags', multiple=True, metavar=':', help='Tag for the created resources: : (can be provided multiple times)') # @click.option('--env', default='dev', type=click.Choice(environments), # help='Default: "dev".\n' # 'The kind of environment you want to create (used for naming and tagging). Some' # ' templates create different kind/sizes of resources based on this parameter' # ' (if you are not sure, do not set this param)') @click.argument('project_name') def create(project_name, profile, templates_config=None, template_key=None, tags={}): """Generate an initial project on AWS based on a template. The CodeCommit repo will be named NAME and all other resources will contain NAME as well to be easily identifiable. """ if profile: print("profile:", profile) if templates_config is None: templates_config = DEFAULT_TEMPLATES_CONFIG with urllib.request.urlopen(templates_config) as resource: templates = yaml.load(resource) template = None if template_key is not None: template = templates.get(template_key) if template is None: print("Could not find template {} in {}".format(template_key, templates_config)) sys.exit(1) elif template_key is None: if len(templates.keys()) == 1: (template_key, template), = templates.items() else: print("template name missing {}. Should be one of {}".format(template_key, list(templates.keys()))) sys.exit(1) clouduct.generate(project_name, profile, template, tags, "dev") def verify_prerequisites(): """Check for terraform.""" pass def main(): create() if __name__ == '__main__': print("sys.argv", sys.argv, file=sys.stderr) verify_prerequisites() create() PK! clouduct/cookicutter/__init__.pyPK!y@\PP/clouduct/cookicutter/project-to-cookiecutter.pyimport os import re from shutil import copyfile from pathmatch import wildmatch exclude_dirs = [".git", ".mvn/repository"] # which kind of project? # INPUT src directory, target directory package2path = str.maketrans(".", "/") path2package = str.maketrans("/", ".") execute_flag = True group_id = "ch.mibelle.skincare" artifact_id = "mibsvc" package_path = group_id.translate(package2path) cookiecutter_file = "cookiecutter.json" src_dir = "/Users/vivo/workspaces/cc/mibelle/mibsvc" target_dir = "/Users/vivo/workspaces/cc/mibelle/mibsvc-cookiecutter" cookie_cutter_target_dir = os.path.join(target_dir, "{{ cookiecutter.project_slug }}") local_gitignore = os.path.join(src_dir, ".gitignore") global_gitginore = os.path.join(os.path.expanduser("~"), ".gitignore") gitignore_filter = re.compile(r"^\s*(#.*)?$") def load_gitignores(gitignore_filename): if os.path.exists(gitignore_filename): with open(gitignore_filename, 'r') as gitignore_file: return [line.rstrip("\n") for line in gitignore_file.readlines() if not gitignore_filter.match(line)] return [] ignore = load_gitignores(global_gitginore) ignore.extend(load_gitignores(local_gitignore)) ignore.extend(exclude_dirs) pom_file = os.path.join(src_dir, "pom.xml") if os.path.exists(pom_file): pass else: gradle_file = os.path.join(src_dir, "build.gradle") if os.path.exists(gradle_file): pass src_main_dir = os.path.join(src_dir, "src", "main") if os.path.exists(src_main_dir): pass if os.path.exists(target_dir): # check --force? print("target directory", target_dir, "already exists. stopping") # sys.exit(1) def handle_file(src_dir, target_dir, file): pass os.makedirs(cookie_cutter_target_dir, exist_ok=True) def path_exclude1(src_dir, dir, exclude_dirs): for exd in exclude_dirs: if exd.startswith("/"): # absolute dir if os.path.join(src_dir, exd[1:]) == dir: return True elif dir.endswith(exd): return True return False def pathmatch_exclude(src_dir, file_or_dir, ignore): rel_path = os.path.relpath(file_or_dir, src_dir) result = False for pattern in ignore: if pattern.startswith("!"): if wildmatch.match(pattern[1:], file_or_dir): result = False elif wildmatch.match(pattern, rel_path): result = True return result for root, dirs, files in os.walk(src_dir): # We are pruning the list of dirs here: os.walk will only use the remaining dirs to go on # (os.walk() lazily 'generates' the files) dirs[:] = [d for d in dirs if not pathmatch_exclude(src_dir, os.path.join(root, d), ignore)] for file in files: src_filename = os.path.join(root, file) if not pathmatch_exclude(src_dir, src_filename, ignore): rel_dir = os.path.relpath(root, src_dir) # print("ROOT: {}\n REL: {}\n new_rel_dir: {}".format(root, rel_dir, new_rel_dir)) if rel_dir != ".": new_rel_dir = rel_dir.replace(package_path, "{{cookiecutter.package_path}}") new_abs_target_dir = os.path.join(cookie_cutter_target_dir, new_rel_dir) else: new_abs_target_dir = cookie_cutter_target_dir # IF in _copy_without_render? # simply copy # ELSE if execute_flag: os.makedirs(new_abs_target_dir, exist_ok=True) target_filename = os.path.join(new_abs_target_dir, file) if execute_flag: try: with open(src_filename, 'r') as src_file, open(target_filename, 'w') as target_file: for src_line in src_file: target_file.write(src_line.replace(group_id, "{{cookiecutter.package}}")) except UnicodeDecodeError: print("probably binary", src_filename, "copying ...") if execute_flag: copyfile(src_filename, target_filename) if execute_flag: copyfile(os.path.join(src_dir, "cookiecutter.json"), os.path.join(target_dir, "cookiecutter.json")) PK! ))clouduct/reseed/__init__.pyfrom .reseed import reseed # noqa: F401 PK!BPPclouduct/reseed/reseed.py#!/usr/bin/env python """Creating a new project based on an existing one. """ import fileinput import os import shutil import sys import pathspec import yaml try: import readline # noqa: F401 except: # noqa E722 pass # ---------------------------------------------------------------------------------------- PATHSPEC_IGNORE = ["/.mvn/repository", '/.git', '/target', '/.clouduct*', '/reseed*'] spec = pathspec.PathSpec.from_lines('gitwildmatch', PATHSPEC_IGNORE) class SimpleLineReplacer: def __init__(self, match, replacement): self.match = match self.replacement = replacement def replace(self, line): return line.replace(self.match, self.replacement) def __repr__(self): return self.match + " => " + self.replacement class Reseed: def __init__(self, src_dir, target_dir=None, config_file=None, input={}, force=False): self.src_dir = src_dir self.input = input self.target_dir = target_dir self.replacers = [] self.dir_replacer = None self.force = force if config_file is None: self.config_file = ".clouduct-reseed" else: self.config_file = config_file with open(os.path.join(self.src_dir, self.config_file), "r") as file: data = yaml.load(file, yaml.Loader) for (name, old_value) in data.items(): if type(old_value) == dict: (old_value, new_value), = old_value.items() self.input[name] = new_value.format(**self.input) new_value = self.ask(name) self.input[name] = new_value self.replacers.append(SimpleLineReplacer(old_value, new_value)) if name == 'package': self.dir_replacer = SimpleLineReplacer(old_value.replace('.', os.sep), new_value.replace('.', os.sep)) if self.target_dir is None and name == 'artifactid': self.target_dir = os.path.join("..", new_value) def ask(self, prompt): if prompt in self.input: print(" # {}: {}".format(prompt, self.input[prompt])) return self.input[prompt] else: return input(" {}: ".format(prompt)) def simple_patch_file(self, file_name, replacers): with fileinput.input(files=(file_name), inplace=True) as file: for line in file: for replacer in replacers: line = replacer.replace(line) print(line, end='') def copy_func(self): def _copy_func(src, dst, *, follow_symlinks=True): """Copies and patches file. """ renamed_dst = self.dir_replacer.replace(dst) # create parent dir if directory has been renamed if renamed_dst != dst: renamed_dir = os.path.dirname(renamed_dst) if not os.path.exists(renamed_dir): os.makedirs(renamed_dir) shutil.copy2(src, renamed_dst, follow_symlinks=follow_symlinks) try: self.simple_patch_file(renamed_dst, self.replacers) except UnicodeDecodeError: # Copy again because fileinput truncates the file. # When using fileinput to _copy_ the file, we would need to do the meta attribute handling # of the file ourselves shutil.copy2(src, renamed_dst, follow_symlinks=follow_symlinks) return _copy_func def ignore_func(self): def _ignore_func(path, names): """Returns files to ignore. shutil.copytree calls this function once fore each directory. The 'path' parameter contains the directory, the 'names' parameter contains all file names in the directory. copytree expects a set of names to be ignored as return value """ ignored_names = [] for name in names: full_path = os.path.join(path, name) if spec.match_file(full_path): ignored_names.append(name) result2 = set(ignored_names) return result2 return _ignore_func def reseed(self): print(self.src_dir, "=>", self.target_dir) current_dir = os.path.realpath(os.path.curdir) os.chdir(self.src_dir) shutil.copytree(".", self.target_dir, copy_function=self.copy_func(), ignore=self.ignore_func()) os.chdir(current_dir) def reseed(src_dir, input={}, target_dir=None, config_file=None, force=False): Reseed(src_dir, target_dir, config_file, input).reseed() if __name__ == "__main__": SRC_DIR = "." if len(sys.argv) > 1: SRC_DIR = sys.argv[1] if len(sys.argv) > 2: target_dir = sys.argv[2] # TODO: argparse for -f etc. reseed(SRC_DIR) PK!2--clouduct/reseed/reseed2.py#!/usr/bin/env python """Creating a new project based on an existing one. """ import fileinput import os import shutil import sys import pathspec import yaml try: import readline # noqa: F401 except: # noqa E722 pass # ---------------------------------------------------------------------------------------- SRC_DIR = "." if len(sys.argv) > 1: SRC_DIR = sys.argv[1] if len(sys.argv) > 2: target_dir = sys.argv[2] else: target_dir = input("Target Dir: ") # TODO: argparse for -f etc. # ---------------------------------------------------------------------------------------- PATHSPEC_IGNORE = ["/.mvn/repository", '/.git', '/target', '/.clouduct*', '/reseed*'] spec = pathspec.PathSpec.from_lines('gitwildmatch', PATHSPEC_IGNORE) class SimpleLineReplacer: def __init__(self, match, replacement=None): self.match = match self.replacement = replacement def replace(self, line): return line.replace(self.match, self.replacement) def __repr__(self): return self.match + " => " + self.replacement class LinePatcher: def __init__(self, gitfilematches): self.gitfilematches = gitfilematches self.compiled_gitfilematches = map(pathspec.patterns.GitWildMatchPattern, gitfilematches) self.replacers = [] def replacer(self, replacer): self.replacers.append(replacer) return self def __repr__(self): return "{} {}".format(self.gitfilematches, self.replacers) class Reseed: def __init__(self, binaries, dir_rename, excludes): self.binaries = map(pathspec.patterns.GitWildMatchPattern, binaries) self.patchers = [] self.excludes = map(pathspec.patterns.GitWildMatchPattern, excludes) self.dir_rename = dir_rename def patcher(self, patcher): self.patchers.append(patcher) return self def __repr__(self): return "dir: {}\npatch: {}".format(self.dir_rename, self.patchers.__repr__()) class JavaReseed(Reseed): def __init__(self, old_package, new_package, binaries, excludes): super().__init__(binaries, SimpleLineReplacer(old_package.replace(".", os.sep), new_package.replace(".", os.sep)), excludes) self.patchers.append(LinePatcher(["*"]).replacer(SimpleLineReplacer(old_package, new_package))) with open(os.path.join(SRC_DIR, ".reseed.yaml")) as file: reseed_conf = yaml.load(file) old_package = reseed_conf["package"] new_package = input("Package name (old: '{}'): ".format(old_package)) reseed = JavaReseed(old_package, new_package, reseed_conf.get("binary"), reseed_conf.get("exclude")) if "patching" in reseed_conf: for patch in reseed_conf["patching"]: files = patch["files"] if type(files) == str: files = [files] patcher = LinePatcher(files) reseed.patcher(patcher) for (prompt, old_value) in patch["replacing"].items(): new_value = input("{}: ".format(prompt)) patcher.replacer(SimpleLineReplacer(old_value, new_value)) print(reseed) sys.exit(0) def simple_patch_file(file_name, replacers): with fileinput.input(files=(file_name), inplace=True) as file: for line in file: for replacer in replacers: line = replacer.replace(line) print(line, end='') replacers = [] dir_replacer = None def copy_func(src, dst, *, follow_symlinks=True): """Copies and patches file. """ renamed_dst = dir_replacer.replace(dst) # create parent dir if directory has been renamed if renamed_dst != dst: renamed_dir = os.path.dirname(renamed_dst) if not os.path.exists(renamed_dir): os.makedirs(renamed_dir) shutil.copy2(src, renamed_dst, follow_symlinks=follow_symlinks) try: simple_patch_file(renamed_dst, replacers) except UnicodeDecodeError: # Copy again because fileinput truncates the file. # When using fileinput to _copy_ the file, we would need to do the meta attribute handling of the filw ourselves shutil.copy2(src, renamed_dst, follow_symlinks=follow_symlinks) def ignore_func(path, names): """Returns files to ignore. shutil.copytree calls this function once fore each directory. The 'path' parameter contains the directory, the 'names' parameter contains all file names in thet directory. copytree expects a set of names to be ignored as return value """ ignored_names = [] for name in names: full_path = os.path.join(path, name) if spec.match_file(full_path): ignored_names.append(name) result2 = set(ignored_names) return result2 print(SRC_DIR, "=>", target_dir) os.chdir(SRC_DIR) # shutil.copytree(".", target_dir, copy_function=copy_func, ignore=ignore_func) PK!$") @cache(100) def foo(name): ... The result of this method will be cahed for 100 seconds before the function foo is really called again """ altchars = '_-'.encode() cache_dir = os.path.join(os.path.expanduser("~"), directory, "cache") try: os.makedirs(cache_dir) except FileExistsError: pass def cache(ttl): def cache_decorator(func): @wraps(func) def func_wrapper(*args, **kwargs): key = base64.b64encode((args.__str__() + kwargs.__str__()).encode(), altchars=altchars).decode() cache_file = os.path.join(cache_dir, func.__qualname__ + '.' + key) print(cache_file) use_cached_value = False try: cache_time = os.path.getmtime(cache_file) now = calendar.timegm(time.gmtime()) if now - cache_time < ttl: use_cached_value = True except FileNotFoundError: pass if use_cached_value: result = pickle.load(open(cache_file, "rb")) else: result = func(*args, **kwargs) pickle.dump(result, open(cache_file, "wb")) return result return func_wrapper return cache_decorator return cache PK!IUclouduct/tui.py#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """TextUI for clouduct.""" import itertools import os import textwrap import boto3 import npyscreen HELP_WIDTH = 40 class SelectOneWithHelp(npyscreen.SelectOne): # noqa: D101 """'Option' Group that displays a help text for the group.""" def __init__(self, *args, **kwargs): # noqa: D102 self.helpText = kwargs["helpText"] self.values_with_help = kwargs.get("values_with_help", None) super().__init__(*args, **kwargs) def update(self, clear=True): """Update an option and displays the 'help' for that option. This is called whenever the cursor moves to the option. When the first option is highlighted this is called multiple times, but for now this works fin anyway. """ super().update(clear) self._show_help() def _show_help(self): """Show the help in the configured help widget. If the widget is not available (because the terminal is width to small: do nothing) """ if self.values_with_help: self.parent.set_help(self.helpText + "\n\n" + self.values_with_help[self.cursor_line]["desc"]) else: self.parent.set_help(self.helpText) class TitleSelectOneWithHelp(npyscreen.TitleSelectOne): """Container with title for 'Option' Group with Help.""" _entry_type = SelectOneWithHelp def _wrap(text, length): for para in text.split("\n"): if len(para) > length: for line in textwrap.wrap(para, length): yield line else: yield para class AwsProfileForm(npyscreen.Form): """TextUI Form for clouduct.""" def __init__(self, env_profile, profiles, *args, **kwargs): self.env_profile = env_profile self.profiles = profiles super().__init__(*args, **kwargs) def set_help(self, text): """"Display the (wrapped) help text.""" self.helpWidget.values = list(_wrap(text, self.helpWidget.width - 6)) self.helpWidget.display() def create(self): """"Create the TextUI.""" term_size = os.get_terminal_size() self.profile = self.add(TitleSelectOneWithHelp, max_height=3, name='Profile', max_width=term_size.columns - 6 - HELP_WIDTH, values=self.profiles, helpText='Profile Help', value=self.profiles.index(self.env_profile), scroll_exit=True ) self.templates = self.add(TitleSelectOneWithHelp, max_height=3, name='Templates', helpText="Choose a template", values_with_help=values1, max_width=term_size.columns - 6 - HELP_WIDTH, values=[value["key"] for value in values1], value=0, scroll_exit=True ) self.helpWidget = self.add(npyscreen.BoxTitle, name='Help', editable=False, width=HELP_WIDTH, height=term_size.lines - 5, relx=-HELP_WIDTH - 4, rely=-(term_size.lines - 2), values=["Blah-Other"] ) def aws_function(*args): """Central Function to display the UI.""" session = boto3.session.Session() profiles = session.available_profiles profile_form = AwsProfileForm(os.environ['AWS_PROFILE'], profiles) profile_form.edit() return profiles[profile_form.profile.value[0]] values1 = [{"key": "rest-spring-beanstalk", "desc": "Web Service using Spring Boot on Elastic Beanstalk"}, {"key": "spa-nginx-ec2", "desc": "Angular Single Page Application served by nginx on EC2"}, {"key": "py-flask-passenger-ec2", "desc": "Python Flask web app using Passenger on EC2"} ] if __name__ == '__main__': print(npyscreen.wrapper_basic(aws_function)) helpText = "Lorem ipsum dolor sit amet, , AFTER>\n \n 0; i-- )) { echo ${!i} } } info() { echo -e "${COLOR_INFO}$1${NO_COLOR}" } warn() { echo -e "${COLOR_WARN}$1${NO_COLOR}" } # -------------------------------------------------------------------------------------------------- # ARGUMENT HANDLING # -------------------------------------------------------------------------------------------------- if [[ "$1" == "--help" ]]; then usage exit 0 fi if [[ "$1" == '-n' ]]; then DRY_RUN=true shift fi if contains "$1" "bootstrap plan apply destroy"; then command="$1" shift fi command=${command:-${DEFAULT_COMMAND}} if contains "$1" "$ALL_ENVS" ; then TF_VAR_environment="$1" shift fi TF_VAR_environment=${TF_VAR_environment:-$DEFAULT_ENVIRONMENT} while contains "$1" "$ALL_PHASES"; do PHASES="$1 $PHASES" shift done if [[ "${PHASES}" = "" ]]; then PHASES_IN_EXEC_ORDER=$ALL_PHASES else # ensure the phases are in the correct order PHASES=$(echo "$PHASES" | sed -e 's/ $//g' -e 's/ /\|/g') for phase in $ALL_PHASES; do if [[ $phase =~ .*${PHASES}.* ]]; then PHASES_IN_EXEC_ORDER="$PHASES_IN_EXEC_ORDER $phase" fi done fi PHASES_IN_EXEC_ORDER=$(trim "$PHASES_IN_EXEC_ORDER") if [[ $# -gt 0 ]]; then echo "unknown parameter(s) $*" echo usage exit 1 fi # -------------------------------------------------------------------------------------------------- # EXECUTE # -------------------------------------------------------------------------------------------------- if [[ "$DRY_RUN" = "true" ]]; then echo "CLOUDUCT DEBUG: DRY RUN only (for script debugging)" fi export TF_VAR_bucket="${TF_VAR_project_name}-clouduct-terraform" INFRA_DIR="$( cd "$( dirname "$0" )" && pwd )" TF_PLUGIN_CACHE_DIR=${INFRA_DIR}/.terraform.d/plugin_cache if [[ $command == "bootstrap" ]]; then mkdir -p "${TF_PLUGIN_CACHE_DIR}" pushd "${INFRA_DIR}/bootstrap" > /dev/null if [[ ! "$DRY_RUN" = "true" ]]; then terraform init -reconfigure terraform apply fi popd > /dev/null else info "CLOUDUCT INFO: project: $TF_VAR_project_name -- env: ($TF_VAR_environment) -- phases: ($PHASES_IN_EXEC_ORDER) command: ($command)" PHASE_COUNT=0 if [[ $command == "destroy" ]]; then PHASES_IN_EXEC_ORDER=$(reverse $PHASES_IN_EXEC_ORDER) fi for phase in ${PHASES_IN_EXEC_ORDER}; do # echo "${INFRA_DIR}/$phase" PHASE_COUNT=$(( PHASE_COUNT + 1 )) if (( PHASE_COUNT == 2 )); then if [[ $command = 'plan' ]]; then warn "CLOUDUCT WARN: You are 'plan'-ing multiple phases." warn " If a later phase depends on a change being applied" warn " in an earlier phase, it will not have happend." warn " You need to 'apply' that earlier phase first" fi fi pushd "${INFRA_DIR}/$phase" > /dev/null if [[ $phase = "global" ]]; then KEY="global" else KEY=${TF_VAR_environment}/${phase} fi # echo "CLOUDUCT DEBUG: terraform state: https://s3.${TF_VAR_region}.amazonaws.com/${TF_VAR_bucket}/${KEY}" info "CLOUDUCT INFO: ${KEY}" if [[ ! "$DRY_RUN" = "true" ]]; then terraform init -reconfigure \ -backend-config="region=${TF_VAR_region}" \ -backend-config="bucket=${TF_VAR_bucket}" \ -backend-config="key=${KEY}" terraform "${command}" fi popd > /dev/null done fi exit 0 PK!H1t3<)clouduct-0.0.2.dist-info/entry_points.txtN+I/N.,()J/M)M.M/).)J, A[&fqqPK!i0UAUA clouduct-0.0.2.dist-info/LICENSEMozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. PK!HlŃTTclouduct-0.0.2.dist-info/WHEEL A н#J@Z|Jmqvh&#hڭw!Ѭ"J˫( } %PK!HbiY!clouduct-0.0.2.dist-info/METADATAO0WQdDD|E">rumG:xksNs`Ȏl@i& 8Ch)]M8ı9'НFE$ -@@z.˷7c*m,qMjs*CF5وv',ᓓnp`պ8*;-ǣ~޷Ӓh lB -Oh"m~0+% E8gUf*j[-\+?3m2LߌG@~ #GDxqAKFH1coGȀƀDQl4U}~>$1-:* lK%8JyPK!H_+'-rclouduct-0.0.2.dist-info/RECORD}IJp`)b?c&!Ty2#3>F?R dfnzH$ȟ{4Hǰ2_Y幜d#Fԏm/ D%j}=B>ȟq seqK**_xn "!U\G|ɴ>{(?{:b,|Bjzap.s9 /VdbJ(m\#F$ԫ{@UFV:4 >%[~Ѩu;ajV*W/2#kFLD.+KVR1Fot$_nx*f|hqNK\4Ia+2?w&48 ( @0;+aQCf 0oDjA%9ty4zϬ"ԦwEus,<`Љ˭+l) ?bԹ1Zl40Zpe:ᆢTI@`x#Z&qGy-yB#Q!ʮ%R8WQ0%'VĊZ%C8,'(Q;uKԭЄXxywqR9~,GMQ~%jցgJ닚 :[ĥMJ%F^5E.fm{֟ɓ9ޓClmV&.z=W0WWx:I] ʥHDf$y?rzf~mE:2PK!(~ffclouduct/__init__.pyPK!T::큘clouduct/clouduct.pyPK!AAclouduct/console/__init__.pyPK!e(CC%clouduct/console/clouductbootstrap.pyPK! clouduct/cookicutter/__init__.pyPK!y@\PP/Cclouduct/cookicutter/project-to-cookiecutter.pyPK! ))'clouduct/reseed/__init__.pyPK!BPPB(clouduct/reseed/reseed.pyPK!2--;clouduct/reseed/reseed2.pyPK!$