Open EandrewJones opened 7 months ago
I have gone around that by using the absolute path with codebuild builtin variable:
.repository({
repoUrl: "odni-seedlings",
credentialsSecretName: credentialsSecretName,
targetRevision: "main",
path: "$CODEBUILD_SRC_DIR/eks",
})
However, It does fail in the artifact upload stage as cdk.out is assuming the output directory is at the root
This can be rectified by either passing the path as primaryOutputDirectory
parameter to CDK pipeline or setting an -o flag to explicityl generate cdk.out
at the root of the build instance
Thanks. I was considering an absolute path, but wasn't sure what the codebuild working directory was. Good to know you can access it via that builtin variable.
However, as you note, it still fails later. I'd like to see a permanent fix for this. It should be a tiny change.
Best
Evan Jones Website: www.ea-jones.com
On Mon, Jan 29, 2024 at 6:56 AM Ammar Rahman @.***> wrote:
I have gone around that by using the absolute path with codebuild builtin variable:
.repository({ repoUrl: "odni-seedlings", credentialsSecretName: credentialsSecretName, targetRevision: "main", path: "$CODEBUILD_SRC_DIR/eks", })
However, It does fail in the artifact upload stage as cdk.out is assuming the output directory is at the root
— Reply to this email directly, view it on GitHub https://github.com/aws-quickstart/cdk-eks-blueprints/issues/913#issuecomment-1914543580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ2T6AOZSPAQO3B36S2QRGTYQ6FAPAVCNFSM6AAAAABCNUG2YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJUGU2DGNJYGA . You are receiving this because you authored the thread.Message ID: @.***>
One potential and fairly complex workaround (if the customer cannot wait for the PR linked here to be merged and released):
Assign the stack that is produced by the pipeline builder to a const, then iterate over the child nodes or use find APIs. There will be a cdkpipelines.CodePipeline construct in the list with id set to the name that you gave to the pipeline. if you get it, you can invoke (construct.synth as cdkpipelines.ShellStep).primaryOutputDirectory("path-to-cdk.out");
One potential and fairly complex workaround (if the customer cannot wait for the PR linked here to be merged and released): Assign the stack that is produced by the pipeline builder to a const, then iterate over the child nodes or use find APIs. There will be a cdkpipelines.CodePipeline construct in the list with id set to the name that you gave to the pipeline. if you get it, you can invoke
(construct.synth as cdkpipelines.ShellStep).primaryOutputDirectory("path-to-cdk.out");
Thanks, Mikhail. I can wait for now.
This is now in 1.14.0 release. Please let me know if it addressed your issue. https://aws-quickstart.github.io/cdk-eks-blueprints/pipelines/#monorepo-support
Describe the bug
I am trying to use a monorepo approach where I store the EKS IaC in one directory alongside various application config directories. The
repository
method allows users to define a relative path that points to a sub-directory containing their EKS blueprint stack. However, this feature does not work.My codepipeline repository is defined as follows:
Expected Behavior
I expect for the pipeline to successfully navigate to the relative path and build.
Current Behavior
The the stack generates a faulty
buildspec.yml
that tries to cd into the relative path twice causing a failed build.Faulty buildspec:
Logs from failed build:
Reproduction Steps
You should be able to reproduce this with an minimal example of a blueprint that uses a code pipeline deployed from a repo with a relative path.
Possible Solution
Remove the cd into the relative path from the build phase of the buildspec.
Additional Information/Context
No response
CDK CLI Version
2.115.0
EKS Blueprints Version
1.13.1
Node.js Version
20.11.0
Environment details (OS name and version, etc.)
Linux EC2
Other information
No response