[aws-codepipeline-actions] fetchSubmodules support for all Sources
See original GitHub issueBitBucketSourceAction
is required to setup a pipeline using BitBucket. It’s easy enough to setup codestar to work with this for private repos. The issue I am running into, is that submodules are not being included in the source code. This makes it impossible to use the pipeline in it’s current state.
Please add the ability to specify submodule in the action and ideally, make it match what is possible in the console. I cannot even choose the events I want to trigger either which is a big issue as well but one I have been dealing with for a while now.
Use Case
Submodules are a necessary part of all git projects I am working on. This limitation is making using pipelines extremely difficult because now the only solution is to use keys and checkout the repo in codebuild. This is not only redundant, it makes this action useless for anything other than a simple git project. Again, you cannot even control the events so you cannot stop building on every commit to the repo. No ability to add a nobuild comment or control the events you want to trigger the build.
Proposed Solution
Ideal solution would be to allow the same props as the Codebuild BitBucketSourceProps: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.BitBucketSourceProps.html
It seems you cannot use that for the pipeline with the CDK and that really stinks because it has everything I need…
Other
I am currently using:
new BitBucketSourceAction({
actionName: 'BitBucket',
branch: this._props.git.branch,
codeBuildCloneOutput: true,
connectionArn: this._props.git.codeStartArn,
output: this._artifactBaseSource,
owner: this._props.git.owner,
repo: this._props.git.repo,
}),
This is what I used to use before I figured out this was not possible to use with code pipeline:
const bbSource = codebuild.Source.bitBucket({
branchOrRef: this._props.git.branch,
cloneDepth: 1,
fetchSubmodules: true,
owner: this._props.git.owner,
repo: this._props.git.repo,
webhook: true,
webhookFilters: [
// Only on PUSH and PR Merged do we build (no support for message yet to allow for no builds)
codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH, codebuild.EventAction.PULL_REQUEST_MERGED).andBranchIs(GIT_REPO_BRANCH)
]
});
The codebuild props allow more control. Ideally, I would prefer the ability to use that over the BitBucketSourceAction
but this is not possible.
It should also be noted that codeBuildCloneOutput
is not very clear on what it does. I cannot find any examples of how to use this properly so not really sure if I even need this.
I cannot select full clone for the repo even though it is an option when I go to edit the source in the pipeline. I bring this up because there is a work-a-round here: https://stackoverflow.com/a/64163023/650206
Basically, I cannot use CDK pipelines yet due to this limitation with the CDK. This seems like a pretty serious issue and moving from BitBucket is not an option. May need to go back to Terraform for this and that is not ideal.
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top GitHub Comments
Hey @jpSimkins ,
thanks for opening the issue. Unfortunately, I’m pretty sure this is a CodePipeline limitation, and there’s not much CDK can do here. If you have premium support, I would suggest opening a feature request through there.
One trick I see a lot of customers use is to have a CodeBuild Project that watches the BitBucket repository with a webhook and
fetchSubmodules: true
, which then publishes the contents as an artifact to S3, and then a CodePipeline gets triggered from that S3 Bucket. A little roundabout, but should work.Thanks, Adam
as a work around, in the commands section of the ShellStep, I included ‘git submodule init’ and ‘git submodule update’ after the ‘npm run build’ which seems to have worked. It is a bit fragile though, as it seems to not work if you put it before that command, even though it shouldn’t matter.