Home > Blockchain >  Assets execution step failing in codepipeline - CDK (Java)
Assets execution step failing in codepipeline - CDK (Java)

Time:12-16

I'm a newbie here and I need any help possible with CDK codepipeline. I'm trying to deploy a module using the pipeline and for some reason its stuck at the 'Assets' execution step.

Error: Cannot read asset manifest at 'assembly-xxxPipelinexxxStack-Deploy/xxxPipelinexxxStackDeployxxxPipelinexxxStackF5F6A16A.assets.json': ENOENT: no such file or directory, stat 'assembly-xxxPipelinexxxStack-Deploy/xxxPipelinexxxStackDeployxxxPipelinexxxStackF5F6A16A.assets.json'

I have checked the cdk.out and it does contain the required file at location assembly-xxxPipelinexxxStack-Deploy/xxxPipelinexxxStackDeployxxxPipelinexxxStackF5F6A16A.assets.json

The auto-created buildspec file is as below:

{
  "version": "0.2",
  "phases": {
    "install": {
      "commands": [
        "npm install -g cdk-assets"
      ]
    },
    "build": {
      "commands": [
        "cdk-assets --path \"assembly-xxxPipelinexxxStack-Deploy/xxxPipelinexxxStackDeployxxxPipelinexxxStackF5F6A16A.assets.json\" --verbose publish \"38341e9ef6b01cd2c7cc3b47cd0d2da98933b1121302bf0b03603950b8ff0bd4:current_account-current_region\""
      ]
    }
  }
}

The pipeline stages are:

  • Source - Success
  • Build - Success
    • Synth - Success
  • Asset
    • FileAsset1 - Failed

Appreciate your time and reply.

CodePudding user response:

You didn't specify this, but I'm assuming you're using CDK pipelines (not aws-cdk-lib.aws_codepipeline).

This is a quirk of CDK pipelines - the buildspec has to change to reflect each change in the asset. What this means in practice is that when you're using assets, you have to enable self-mutation for the pipeline, which you disabled, it seems.

  • Related