def init_argparse()

in 02_bootstrap-scripts-python/bootstrap/bootstrap.py [0:0]


def init_argparse() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser(
        usage="%(prog)s [OPTION] [ACTION]",
        description="The cli for the bootstrap will run a helm update with values sourced from additional contexts like SSM parameters or certain environment variables. npm bin should be in your path. The script takes the following flags"
    )
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--json", help="The path to the config JSON for setting up values from config files")
    parser.add_argument(
        "--artifact", help="The path to the output JSON from the stages containing stack output. This is required if --json is specified")
    parser.add_argument(
        "--context", help="A context to register with helm, see details below. This flag can be set multiple times", nargs='*', action='append')
    parser.add_argument(
        "--chart", help="Path to the helm chart to deploy, if not the application will pull the chart depending on the flags.")
    parser.add_argument(
        "--values", help="Path to values file (if not using the one at the root of the chart.")
    parser.add_argument("--release", help="Helm release name", required=True)
    parser.add_argument(
        "--print_values", help="Print generated values.", action='store_true')
    parser.add_argument("--helm", help="Deploy Helm Chart.",
                        action='store_true')
    parser.add_argument("--bindserviceaccounts",
                        help="Allow Helm to provision and bind IAM roles to K8S service accounts", action='store_true')
    parser.add_argument(
        "--helm_arg", help="Arguments to be passed to the helm upgrade command", nargs='*', action='append')
    parser.add_argument(
        '--upgrade', help='Upgrade the chart release.', action='store_true')
    parser.add_argument(
        '--template', help='Print the generated template.', action='store_true')
    return parser