I am new to AWS CodePipeline and I am getting this Error on AWS CodeBuild
"YAML_FILE_ERROR Message: Wrong number of container tags, expected 1"
I have setup AWS CodePipeline with CodeBuild and CloudFormation for aspnet core 2.1 project. Here is my buildspec.yml
{
"name": "Utility",
"source": {
"type": "S3",
"location": "<location>/windows-dotnetcore.zip"
},
"artifacts": {
"type": "S3",
"location": "<location>",
"packaging": "ZIP",
"name": "Utility.zip"
},
"environment": {
"type": "LINUX_CONTAINER",
"image": "aws/codebuild/dot-net:core-2.1",
"computeType": "BUILD_GENERAL1_SMALL"
},
"serviceRole": "<value>",
"encryptionKey": "<value>"
}
This happened for me when I omitted the first 'version' line from yml:
version: 0.2
I received this error when I had a blank buildspec.yml checked in to CodeCommit. Once I updated it with something like this I was good to go:
version: 0.2
phases:
install:
commands:
- echo Installing Mocha...
- npm install -g mocha
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install unit.js
build:
commands:
- echo Build started on `date`
- echo Compiling the Node.js code
- mocha HelloWorld.js
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- HelloWorld.js
Out of curiosity I thought it might have been a formatting error, but I tried checking in some garbage text and received the following error instead:
Phase context status code: YAML_FILE_ERROR Message: stat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With