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

[cdk-pipelines] ShellScriptAction: add option to configure build image (and other environment settings) #10919

Closed
arpowers opened this issue Oct 17, 2020 · 3 comments · Fixed by #11229
Assignees
Labels
@aws-cdk/pipelines CDK Pipelines library effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p2

Comments

@arpowers
Copy link

Hey guys, great work on CDK!

Looks like I found a bug/bottleneck/critical-feature in the Pipeline construct. Namely, you can't set the environment for certain steps like the ShellScriptAction. In my case, I'm using Node 14 and I get errors like:

The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.18.0"

In the synth actions, it allows me to set the image, just not in further steps.

A quick scan of the codebase suggests the problem is here:

environment: { buildImage: codebuild.LinuxBuildImage.STANDARD_4_0 },

Reproduction Steps

  • Set package.json Node engine to 14
  • Run ShellScriptAction during pipeline process

What did you expect to happen?

Would allow me to set the build environment.

What actually happened?

The environment is hard-coded.

@arpowers arpowers added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2020
@SomayaB SomayaB changed the title Pipelines Environment is Hard Coded (Node engine errors with v14+) [cdk-pipelines] Pipelines Environment is Hard Coded (Node engine errors with v14+) Oct 19, 2020
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Oct 19, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 26, 2020

As a workaround, you can create a CodeBuild project directly and add it to the pipeline, rather than having one created for you. This gives you more flexibility.

@rix0rrr rix0rrr changed the title [cdk-pipelines] Pipelines Environment is Hard Coded (Node engine errors with v14+) [cdk-pipelines] ShellScriptAction: add option to configure build image (and other environment settings) Oct 26, 2020
@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2 and removed bug This issue is a bug. labels Oct 26, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Oct 26, 2020
@tdikland
Copy link
Contributor

I will try to implement this in the coming days.

tdikland added a commit to tdikland/aws-cdk that referenced this issue Oct 30, 2020
The codebuild image of the ShellScriptAction was hardcoded. Some validation scripts require a different codebuild image.
This commit adds a property to the ShellScriptAction class to specify the image, which defaults to linux_4_0 (the current hardcoded value).
fixes aws#10919
tdikland added a commit to tdikland/aws-cdk that referenced this issue Oct 30, 2020
…nvironment

The build environment for the ShellScriptAction is hardcoded and set to LINUX_4_0.

This fix allows the build environment to be specified in the ShellScriptAction
fixes aws#10919
tdikland added a commit to tdikland/aws-cdk that referenced this issue Oct 30, 2020
…environment

The build environment for the ShellScriptAction is hardcoded and set to LINUX_4_0.

This fix allows the build environment to be specified in the ShellScriptAction
fixes aws#10919
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Nov 2, 2020
@mergify mergify bot closed this as completed in #11229 Nov 9, 2020
mergify bot pushed a commit that referenced this issue Nov 9, 2020
The build environment for the ShellScriptAction is hardcoded and set to LINUX_4_0.

This fix allows the build environment to be specified in the ShellScriptAction
fixes #10919



----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Nov 9, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants