-
Notifications
You must be signed in to change notification settings - Fork 343
fix(java): fixed sample code and created CI job to validate #264
Conversation
"### Pull Request Checklist * [ ] Testing - Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change) * [ ] Title and Description - Change type: title prefixed with fix, feat and module name in parens, which will appear in changelog - Title: use lower-case and doesn't end with a period - Breaking?: last paragraph: 'BREAKING CHANGE: <describe what changed + link for details>' - Issues: Indicate issues fixed via: 'Fixes #xxx' or 'Closes #xxx'" |
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
|
||
import software.amazon.awscdk.services.codepipeline.actions.CodeCommitSourceAction; | ||
|
||
public class WorkshopPipelineStack extends Stack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java would throw an error if the class did not match the filename. To resolve this I renamed the class to PipelineStack
.
|
||
public final CfnOutput hcViewerUrl; | ||
public final CfnOutput hcEndpoint; | ||
|
||
public WorkshopPipelineStage(final Construct scope, final String id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as PipelineStack
. The class must match the file name.
deployStage.addActions(ShellScriptAction.Builder.create() | ||
.actionName("TestViewerEndpoint") | ||
.useOutputs(Map.of("ENDPOINT_URL", deploy.hcViewerUrl)) | ||
.commands(List.of("curl -Ssf $ENDPOINT_URL")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map.of
and List.of
are not supported in Java 8 which is the minimum Java version we support.
To fix this I replaced..
Map.of
withfinal Map<String, StackOutput> TestViewerEndpointOutputs = new HashMap
List.of
withArrays.asList
There was also an existing type error that was being thrown on the useOutputs()
param. To fix this I replaced deploy.hcEndpoint
with pipeline.stackOutput(deploy.hcEndpoint)
to get the appropriate type object that is expected in useOutputs()
.
Summary
This PR implements CI workflows that verify changes do not break builds.
cdk synth
Fixes #259, #189, #152
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.