How To Use Secondary Buildspec file

106 views Asked by At

I have two buildspec files:

  1. buildspec.yml
  2. buildspectest.yml

And two Codebuild actions:

- Actions:
- ActionTypeId:
    Category: "Build"
    Owner: "AWS"
    Provider: "CodeBuild"
    Version: "1"
  Configuration:
    ProjectName: !Ref CodeBuild
  InputArtifacts:
    - Name: 'SourceArtifact'
  Name: "Build"
  Region: !Sub ${AWS::Region}
  RunOrder: 1

- Actions:
- ActionTypeId:
    Category: "Test"
    Owner: "AWS"
    Provider: "CodeBuild"
    Version: "1"
  Configuration:
    ProjectName: !Ref CodeBuild
  InputArtifacts:
    - Name: 'SourceArtifact'
  Name: "Test"
  Region: !Sub ${AWS::Region}
  RunOrder: 1

They are both referenced to the same build project. They both seem to load buildspec.yml file. How do I configure my second Codebuild Test action to use buildspectest.yml and the first one to use buildspec.yml?

1

There are 1 answers

0
Robert Kossendey On BEST ANSWER

You are referencing in both actions the same configuration with !Ref CodeBuild. You would have to create two different configurations for the different buildspecs.