-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(pipelines): Add ability to specify Codepipeline variable namespace on CodePipelineSource classes. #16407
Comments
Looking through existing PRs I found #15964 and the related issue #15943. While the other issue and PR are specifically related to the sourceInput = CodePipelineSource.codeCommit( /* ... */ );
const pipeline = new CodePipeline(this, `${id}PipelineResource`, {
synth: new SynthStep(/* ... */),
codeBuildDefaults: {
buildEnvironment: {
environmentVariables: {
COMMIT_MESSAGE: {
type: BuildEnvironmentVariableType.PLAINTEXT,
value: sourceAction.variable('CommitMessage),
},
},
},
},
/* ... */
}); |
Make it possible to export environment variables from a CodeBuildStep, and pipeline sources, and use them in the environment variables of a CodeBuildStep or ShellStep. Closes #17189, closes #18893, closes #15943, closes #16407. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
I would like to be able to specify the CodePipeline variable namespace, and/or access the variable properties of the underlying action constructs for CodePipline source classes and potentially the other Step classes.
Use Case
I am looking to implement automated semantic versioning of my private NPM package using CDK pipelines for CI/CD and the standard-version NPM package. To support this use-case I would like to use bash in CodeBuild to conditionally determine whether to publish the package based off commit message, as below:
In order to do this I obviously have to make the commit message available to CodeBuild since it isn't by default. The most obvious way to do this was via CodePipeline variables and I was disappointed to find that the higher level APIs of CDK Pipelines do not provide a way to access them.
Proposed Solution
One approach would be to allow specifying the the namespace when creating the CodePipelineSource object by specifying it in the props as in:
An alternative approach would be to allow users to access the variable properties of the underlying action, e.g:
My use case requires this feature to be implemented on the child classes of CodePipelineSource, but for consistency it should probably be added to all relevant Step classes (those whose actions allow you to specify namespace).
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: