Esempio n. 1
0
def bootstrap():
    """
    Bootstrap the factory.  This will create the AWS CodeCommit repo containing the config and it will also create the
    AWS CodePipeline that will run the solution.

    """
    core.bootstrap()
Esempio n. 2
0
def bootstrap(
    source_provider,
    repository_name,
    branch_name,
    owner,
    repo,
    branch,
    poll_for_source_changes,
    webhook_secret,
):
    if source_provider == "CodeCommit":
        core.bootstrap(
            source_provider,
            None,
            repository_name,
            branch_name,
            poll_for_source_changes,
            webhook_secret,
        )
    elif source_provider == "GitHub":
        core.bootstrap(
            source_provider,
            owner,
            repo,
            branch,
            poll_for_source_changes,
            webhook_secret,
        )
    else:
        raise Exception(f"Unsupported source provider: {source_provider}")
Esempio n. 3
0
def bootstrap():
    core.bootstrap()
Esempio n. 4
0
def bootstrap(
    source_provider,
    repository_name,
    branch_name,
    owner,
    repo,
    branch,
    poll_for_source_changes,
    webhook_secret,
    scm_connection_arn,
    scm_full_repository_id,
    scm_branch_name,
    scm_bucket_name,
    scm_object_key,
    create_repo,
):
    args = dict(
        source_provider=source_provider,
        owner=None,
        repo=None,
        branch=None,
        poll_for_source_changes=poll_for_source_changes,
        webhook_secret=None,
        scm_connection_arn=None,
        scm_full_repository_id=None,
        scm_branch_name=None,
        scm_bucket_name=None,
        scm_object_key=None,
        create_repo=create_repo,
    )

    if source_provider == "CodeCommit":
        args.update(
            dict(
                repo=repository_name,
                branch=branch_name,
                poll_for_source_changes=poll_for_source_changes,
            ))

    elif source_provider == "GitHub":
        args.update(
            dict(
                owner=owner,
                repo=repo,
                branch=branch,
                poll_for_source_changes=poll_for_source_changes,
                webhook_secret=webhook_secret,
            ))

    elif source_provider == "CodeStarSourceConnection":
        args.update(
            dict(
                scm_connection_arn=scm_connection_arn,
                scm_full_repository_id=scm_full_repository_id,
                scm_branch_name=scm_branch_name,
            ))
    elif source_provider == "S3":
        args.update(
            dict(
                scm_bucket_name=scm_bucket_name,
                scm_object_key=scm_object_key,
            ))
    else:
        raise Exception(f"Unsupported source provider: {source_provider}")

    core.bootstrap(**args)