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

[@aws-cdk/pipelines] Allow multiple build / install commands for SimpleSynthAction #9357

Closed
1 task done
timbaer opened this issue Jul 30, 2020 · 1 comment · Fixed by #10152
Closed
1 task done
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. needs-triage This issue or PR still needs to be triaged. p2

Comments

@timbaer
Copy link

timbaer commented Jul 30, 2020

I think the buildspec generation in the SimpleSynthAction can be improved. For cases where you need run additional build-commands (e.g. build lambda-sources before synth), it would be good to have a way to pass multiple install and build commands to the SimpleSynthAction. A good way would be to provide a string-array for parameter SimpleSynthAction.buildCommand and SimpleSynthAction.installCommand.

Currently, I'm helping myself by concatenating all install/build commands as follows:

SimpleSynthAction.standardNpmSynth({
                sourceArtifact,
                cloudAssemblyArtifact,
                installCommand: 'npm ci --prefix ../lambda/create' +
                    '&& npm ci --prefix ../lambda/update' +
                    '&& npm ci',
                buildCommand: 'npm run build --prefix ../lambda/create' +
                    '&& npm run build --prefix ../lambda/update' +
                    '&& npm run build'
            }

Use Case

As a cdk-pipeline user, I want to pass a list of build-commands / actions to the build action of a pipeline to run them one after another or in parallel.

Proposed Solution

  1. change parameter-type of buildCommand and installCommand from string to Array
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@timbaer timbaer added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 30, 2020
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Jul 30, 2020
@asterikx
Copy link
Contributor

Similar to #9021

@ericzbeard ericzbeard assigned rix0rrr and unassigned ericzbeard Jul 30, 2020
@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p2 labels Aug 4, 2020
@rix0rrr rix0rrr added this to the [CDK Pipelines] Soon milestone Aug 12, 2020
rix0rrr added a commit that referenced this issue Sep 3, 2020
Change the single-string versions of `buildCommand` and
`installCommand`, and turn them into arrays.

People don't have to do `'command1 && command2'` anymore but can now
simply supply an array of `['command1', 'command2']` which is more
natural.

Fixes #9357.
@mergify mergify bot closed this as completed in #10152 Sep 3, 2020
mergify bot pushed a commit that referenced this issue Sep 3, 2020
…10152)

Change the single-string versions of `buildCommand` and
`installCommand`, and turn them into arrays.

People don't have to do `'command1 && command2'` anymore but can now
simply supply an array of `['command1', 'command2']` which is more
natural.

Fixes #9357.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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. needs-triage This issue or PR still needs to be triaged. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants