Skip to content

Instantly share code, notes, and snippets.

@josjaf
Created August 21, 2019 16:39
Show Gist options
  • Save josjaf/9c5a54f7d7a395c33b29fdcb1ce348e9 to your computer and use it in GitHub Desktop.
Save josjaf/9c5a54f7d7a395c33b29fdcb1ce348e9 to your computer and use it in GitHub Desktop.
from aws_cdk import (
aws_iam as aws_iam,
aws_s3 as aws_s3,
aws_ecr,
aws_codebuild,
aws_codepipeline,
aws_codepipeline_actions,
aws_s3,
core,
)
class Pipeline(core.Stack):
def __init__(self, app: core.App, id: str, props, **kwargs) -> None:
super().__init__(app, id, **kwargs)
source_output = aws_codepipeline.Artifact(artifact_name='source')
repo_kid_source = aws_codepipeline.Artifact(artifact_name='repokidsource')
# source_output = aws_codepipeline.Artifact()
print(props.bucket_obj.bucket_arn)
pipeline = aws_codepipeline.Pipeline(
self,
"Pipeline",
pipeline_name=f"{props.namespace}",
artifact_bucket=props.bucket_obj,
# role=codepipeline_role,
stages=[
aws_codepipeline.StageProps(
stage_name='Source',
actions=[
aws_codepipeline_actions.S3SourceAction(
bucket=props.bucket_obj,
bucket_key='source.zip',
action_name='S3Source',
run_order=1,
output=source_output,
# role=codepipeline_role
),
# aws_codepipeline_actions.CodeCommitSourceAction(
# repository=props.repo_kid_code_commit,
# branch='master',
# output=repo_kid_source,
# action_name='RepoKidSource'
#
# )
],
),
aws_codepipeline.StageProps(
stage_name='Build',
actions=[aws_codepipeline_actions.CodeBuildAction(
action_name='DockerBuildImages',
# role=codepipeline_role,
input=source_output,
project=props.codebuild_docker_build_aardvark,
run_order=1,
)
]
)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment