问题
I am deploying an application using AWS code deploy to Windows environment. I use an apspec.yml yaml file. When I deploy the application I get following error
The deployment failed because an invalid version value () was entered in the application specification file. Make sure your AppSpec file specifies "0.0" as the version, and then try again.
It seems like there is a problem with encoding or line ending. All the materials in the internet are for linux but not for windows. I use visual studio editor to edit this file. How to fix this issue?
回答1:
The issue is in the line ending. If you create a yml file make sure you use \n line ending (linux way of line ending) instead of \r\n (windows way of line ending). If your editor is visual studio when you safe the yml file save it as follows. File->Advanced Saved Options
回答2:
In my case the encoding was wrong. appspec.yml
should be saved as UTF-8
and not UTF-8 BOM
.
BTW: The encoding can be changed in VS 2017 using File > Save as..
, then the down arrow at the Save-Button ... Save with encoding...
回答3:
Make sure your appspec.yml starts with below line
version: 0.0
codedeploy requires this attribute as must. refer this
来源:https://stackoverflow.com/questions/43485953/aws-codedeploy-ymal-file-error