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

feat: support cfn outputs #67

Merged
merged 29 commits into from
Jan 19, 2022
Merged

feat: support cfn outputs #67

merged 29 commits into from
Jan 19, 2022

Conversation

kaizencc
Copy link
Contributor

@kaizencc kaizencc commented Jan 14, 2022

This PR adds support for cfn outputs. You can specify a Cfn Output as an environment variable like so:

pipeline.addStage(myStage, {
      pre: [new ShellStep('Pre', {
        commands: ['echo hello'],
      })],
      post: [new ShellStep('Post', {
        envFromCfnOutputs: {
          FN_NAME: myStage.fnName,
        },
        commands: ['echo FN_NAME equals: $FN_NAME'],
      })],
    });

This translates to a deploy.yml file with an output for the deploy step:

    outputs:
      myout: \${{ steps.Deploy.outputs.myout }}

As well as sets the environment variable for the Post step:

    env:
      FN_NAME: \${{ needs.StageA-FunctionStack-Deploy.outputs.myout }}
    steps:
      - run: \\"echo FN_NAME equals: $FN_NAME\\"

kaizencc and others added 16 commits January 13, 2022 11:45
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
needs:
- StageA-FunctionStack-Deploy
- StageA-BucketStack-Deploy
- StageA-FunctionStack-Deploy
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone can figure out why I depend on StageA-FunctionStack-Deploy twice, that would be great :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be a bug on the pipelines construct, and does not impact the performance (just looks ugly)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking: aws/aws-cdk#18450

@kaizencc kaizencc changed the base branch from main to conroy/assets January 14, 2022 15:14
kaizencc and others added 11 commits January 14, 2022 15:36
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
@kaizencc kaizencc marked this pull request as ready for review January 14, 2022 23:23
@kaizencc kaizencc requested a review from rix0rrr January 14, 2022 23:28
mergify bot pushed a commit to aws/aws-cdk that referenced this pull request Jan 19, 2022
`GraphNode.allDeps` allows duplicate dependencies to be returned. This does not have any affect on the performance of the pipelines module, but looks ugly. This was noticed in cdklabs/cdk-pipelines-github#67, where the dependencies are written out to the `deploy.yaml` file. 

I did not change the underlying `GraphNode.dependencies` structure to be a set (although I think it should) because I feel like that is a breaking change. So instead I've preserved the structure of the API and deduplicated the list of GraphNodes.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Base automatically changed from conroy/assets to main January 19, 2022 14:53
@rix0rrr rix0rrr merged commit a5d1eba into main Jan 19, 2022
@rix0rrr rix0rrr deleted the conroy/outputs branch January 19, 2022 14:56
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
`GraphNode.allDeps` allows duplicate dependencies to be returned. This does not have any affect on the performance of the pipelines module, but looks ugly. This was noticed in cdklabs/cdk-pipelines-github#67, where the dependencies are written out to the `deploy.yaml` file. 

I did not change the underlying `GraphNode.dependencies` structure to be a set (although I think it should) because I feel like that is a breaking change. So instead I've preserved the structure of the API and deduplicated the list of GraphNodes.

----

*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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants