question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asset support in CI/CD pipelines

See original GitHub issue

Hi

I’m trying to follow these steps CodePipeline Actions for CloudFormation for building with CFN, but I’m have a hard time to make templatePath work.

CodeBuild calls cdk synth (and outputs template.yaml) then I set as the templatePath as follows:

const project = new codebuild.PipelineProject(this, 'Project', {
  environment: {
    buildImage: codebuild.LinuxBuildImage.UBUNTU_14_04_NODEJS_10_1_0
  },
  buildSpec: {
    version: '0.2',
    phases: {
      install: {
        commands: [
          '...'
        ]
      },
      build: {
        commands: [
          'cdk synth > ../template.yaml'
        ]
      }
    },
    artifacts: {
      files: ['template.yaml']
    }
  }
})

// ...

const pipeline = new codepipeline.Pipeline(this, 'CodePipeline', {})

const build = new codebuild.PipelineBuildAction(this, 'CodeBuild', {
  stage: pipeline.addStage('Build'),
  project,
  outputArtifactName: 'Build'
})

new cfn.PipelineCreateReplaceChangeSetAction(prodStage, 'PrepareChanges', {
  stage: prodStage,
  stackName,
  changeSetName,
  adminPermissions: true,
  templatePath: build.outputArtifact.atPath('template.yaml')
})

But I keep getting this error on the PrepareChanges stage:

image

I checked the artifact generated in the build stage and the template.yaml is in there.

Just as a random attempt, I’ve also tried to commit the template.yaml and use directly from source instead of build:

new codepipeline.GitHubSourceAction(this, 'GitHubSource', {
  stage: pipeline.addStage('Source'),
  owner: 'project',
  repo: 'repo',
  branch: 'master',
  oauthToken: new Secret(oauth.value),
  outputArtifactName: 'Source'
})

new cfn.PipelineCreateReplaceChangeSetAction(prodStage, 'PrepareChanges', {
  stage: prodStage,
  stackName,
  changeSetName,
  adminPermissions: true,
  templatePath: source.outputArtifact.atPath('template.yaml')
})

But it didn’t work, I got the same error.

Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

19reactions
saltman424commented, Feb 18, 2020

Any updates on when this is expected to be supported?

7reactions
rix0rrrcommented, Aug 12, 2020

This has been implemented as CDK Pipelines.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 REASONS TO ADD ASSET TRACKING TO YOUR CI/CD ...
3 REASONS TO ADD ASSET TRACKING TO YOUR CI/CD PIPELINE · 1. Because Spreadsheets are Not Your Friend · 2. Because You Have...
Read more >
Look into creating a CICD pipeline for assets so that ... - GitLab
Look into creating a CICD pipeline for assets so that that object storage is used as an origin for the CDN. Currently on...
Read more >
Securing CI/CD pipelines: Protecting your assets - The Stack
Securing CI/CD pipelines is critical. The pipeline itself can govern what code is acceptable pre-deployment, what will need to be rewritten.
Read more >
CI/CD: Continuous Integration & Delivery Explained
CI/CD is a way of developing software in which you can release updates at any time without problems. Here's what it takes.
Read more >
9 ways to infuse security in your CI/CD pipeline - TechTarget
Rapid release cycles need not compromise the security of an application and supporting infrastructure. Follow these guidelines to ensure ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found