Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CodeBuild Sources & Artifacts to a separate package #2037

Closed
skinny85 opened this issue Mar 18, 2019 · 4 comments
Closed

Move CodeBuild Sources & Artifacts to a separate package #2037

skinny85 opened this issue Mar 18, 2019 · 4 comments
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort

Comments

@skinny85
Copy link
Contributor

According to what we agreed to in #1743, we need to move CodeBuild's Sources and Artifacts to a separate package.

We should also make a decision whether we should have 2 new packages: one for Sources, one for Artifacts, or should we put both Sources and Artifacts in one new package.

@skinny85 skinny85 added @aws-cdk/aws-codebuild Related to AWS CodeBuild gap effort/medium Medium work item – several days of effort labels Mar 18, 2019
@made2591
Copy link
Contributor

Yes, I have some questions about this: I try to model a stack with a pipeline inside made of 4 step (GitHubSourceAction, CodeBuildBuildAction, S3DeployAction and a LambdaInvokeAction): the use case is a Github repo and a github webhook (also managed with CDK) that contains a static website hosted on s3. The pipeline run, build (jekyll build and put artifact in a transition bucket), deploy (unpacking the artifact to an origin bucket) and run a lambda (cloudfront cache invalidation) as a final step. Now I'm encountering some issue in defining the actions: the GitHubSourceAction should be fine. For the CodeBuildBuildAction I'm already encounering some issue: looking at the CodeBuildBuildActionProps interface it seems that only outputArtifactName is required other then CommonCodeBuildActionProps properties. But I cannot init an Artifact object because I don't have visibility of it. Do you have any suggestions about how to work with CodeBuildBuildAction? I'm working with codepipeline 0.28.0 and using already the aws-codepipeline-actions package

@skinny85
Copy link
Contributor Author

Hey @made2591 ,

you need to have the GitHub source Action as a local variable, and use its outputArtifact property. Like this:

const sourceAction = new cpactions.GitHubSourceAction({
    actionName: 'Source',
    owner: 'skinny85',
    repo: 'test-code-build-deploy-spring-boot-project',
    oauthToken: cdk.SecretValue.secretsManager('my-github-token'),
    branch: 'webhook-test',
    outputArtifactName: 'SourceOutput',
});

And then in your CodeBuild Action:

new cpactions.CodeBuildBuildAction({
    actionName: 'CodeBuild',
    project,
    inputArtifact: sourceAction.outputArtifact,
}),

Hope this helps!

Thanks,
Adam

@made2591
Copy link
Contributor

Thank you @skinny85 I will try it right now and let you now!

skinny85 added a commit to skinny85/aws-cdk that referenced this issue Jun 4, 2019
@skinny85
Copy link
Contributor Author

We decided not to pursue this direction, instead opting to leave the sources and artifacts in the same package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort
Projects
None yet
Development

No branches or pull requests

2 participants