git AWS CodePipeline,构建失败并出现 YAML_FILE_ERROR M 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41314791/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AWS CodePipeline, build failed & getting error as YAML_FILE_ERROR M
提问by Vinod Kumar
I'm new to AWS CodePipeline and never had past experience with any continuous integration tool like Jenkins, etc. I have created a new AWS CodePipeline as AWS CodeCommit (Code repository) -> CodeBuild (not docker, and environment is NodeJS 7)-> AWS CodeDeploy.Everything is on AWS only. It is an Angular2 project which is running finally deployed on EC2 instances (Windows server 2008). From my local machine, I'm able to commit my code to AWS CodeCommit through active IAM user (Git access) and then I can see CodePipleline starts functioning where Source is fine (green in color) but next step i.e. Build fails (red in color). When I click on its details, I can see following error log :-
我是 AWS CodePipeline 的新手,从来没有使用任何持续集成工具(如 Jenkins 等)的经验。我创建了一个新的 AWS CodePipeline作为 AWS CodeCommit(代码存储库)-> CodeBuild(不是 docker,环境是 NodeJS 7)- > AWS CodeDeploy。一切都只在 AWS 上。这是一个 Angular2 项目,最终部署在 EC2 实例(Windows Server 2008)上运行。在我的本地机器上,我可以通过活动的 IAM 用户(Git 访问)将我的代码提交到 AWS CodeCommit,然后我可以看到 CodePipleline 在源正常(绿色)但下一步即构建失败(红色颜色)。当我点击它的详细信息时,我可以看到以下错误日志:-
https://forums.aws.amazon.com/2016/12/23 18:21:16 Waiting for agent https://forums.aws.amazon.com/2016/12/23 18:21:36 Phase is DOWNLOAD_SOURCE https://forums.aws.amazon.com/2016/12/23 18:21:38 Phase complete: DOWNLOAD_SOURCE Success: false https://forums.aws.amazon.com/2016/12/23 18:21:38 Phase context status code: YAML_FILE_ERROR Message: YAML file does not exist https://forums.aws.amazon.com/2016/12/23 18:21:38 Runtime error (YAML file does not exist)
https://forums.aws.amazon.com/2016/12/23 18:21:16 等待代理 https://forums.aws.amazon.com/2016/12/23 18:21:36 阶段是 DOWNLOAD_SOURCE https://forums.aws.amazon.com/2016/12/23 18:21:38 阶段完成:DOWNLOAD_SOURCE 成功:false https://forums.aws.amazon.com/2016/12/2318:21: 38 阶段上下文状态代码:YAML_FILE_ERROR 消息:YAML 文件不存在 https://forums.aws.amazon.com/2016/12/23 18:21:38 运行时错误(YAML 文件不存在)
Can somebody please guide me on this error? I do not know what does this YAML file means. I googled but nothing relevant found in terms of my NodeJS Angular project.
有人可以指导我解决这个错误吗?我不知道这个 YAML 文件是什么意思。我用谷歌搜索但没有发现与我的 NodeJS Angular 项目相关的内容。
Thank you, Vinod Kumar
谢谢你,维诺德·库马尔
回答by Eric Johnson
The YAML file being referenced is the buildspec.yml file required by CodeBuild. More information can be found at http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
所引用的 YAML 文件是 CodeBuild 所需的 buildspec.yml 文件。更多信息可以在http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html找到
回答by froi
Already answered but just adding in just in case someone else encounters this issue.
已经回答但只是添加以防万一其他人遇到这个问题。
Yaml files are usually associated with .yaml or .yml extensions.
Yaml 文件通常与 .yaml 或 .yml 扩展名相关联。
Code build seems to look for buildspec.yml, and can't see .yaml ones.
代码构建似乎在寻找 buildspec.yml,而看不到 .yaml 的。
回答by Mohan Kumar L N
Before
前
version: 0.2
版本:0.2
phases:
install:
runtime-versions:
java: openjdk8
commands:
- echo intall
pre_build:
commands:
- echo pre_build
build:
commands:
- mvn package
- echo build
post_build:
commands:
- echo post_build
artifacts:
files:
- target/spring-boot-rest-api-h2-aws-continious-deloy-0.0.1-SNAPSHOT.jar
After Indentation
缩进后
version: 0.2
版本:0.2
phases:
install:
runtime-versions:
java: openjdk8
commands:
- echo intall
pre_build:
commands:
- echo pre_build
build:
commands:
- mvn package
- echo build
post_build:
commands:
- echo post_build
artifacts:
files:
- target/spring-boot-rest-api-h2-aws-continious-deloy-0.0.1-SNAPSHOT.jar