def upload_pipeline()

in build_pipeline/pipelines/pipeline.py [0:0]


def upload_pipeline(pipeline: Pipeline, default_bucket, base_job_prefix):
    # Get the pipeline definition
    pipeline_definition_body = pipeline.definition()
    # Upload the pipeline to a unique location in s3 based on git commit and timestamp
    pipeline_name = name_from_base(f"{base_job_prefix}/pipeline")
    S3Uploader.upload_string_as_file_body(
        pipeline_definition_body, f"s3://{default_bucket}/{pipeline_name}.json"
    )
    # Return JSON with parameters used in Cfn Stack creation as template-configuration.json
    return {
        "PipelineDefinitionBucket": default_bucket,
        "PipelineDefinitionKey": f"{pipeline_name}.json",
    }