所以我一直在尝试为我的应用程序设置代码部署,但它一直失败。最初,我的存储库中没有 appspec.yml 文件,因此我收到了 appspec.yml 文件不存在的错误消息。
我现在已经包含了一个 appspec.yml 文件,但它仍然不起作用,并且没有给出任何错误消息。没有提到任何事件,就像添加 appspec 文件之前那样。
在创建 appspec.yml 文件方面,我的知识还不够初学者,但我从 YouTube 教程中得到了提示,这是该文件。
version: 0.0
os: linux
files:
- source: /
destination: /var/www/cms
如果有帮助的话,ec2 实例正在运行一个 ubuntu 服务器,/var/www/cms 是 nginx 应该从中提供文件的目录。
最佳答案
您面临的最可能的问题是未安装代理或实例没有足够的权限。如果部署实例上没有启动任何事件,则意味着 CodeDeploy 由于某些原因无法与主机通信。
这是我要采取的步骤:
- Confirm that you installed the CodeDeploy agent
- Confirm that you've created the IAM service role
- Confirm that you have the IAM Instance Profile and that it's associated with the instance
- 检查您是否可以从框中访问您所在区域的 CodeDeploy 命令端点。即
ping codedeploy.us-east-1.amazonaws.com
否则,您的网络设置可能过于严格。 - Look at the logs on the host to see what's going on
关于amazon-web-services - 代码部署失败,没有任何错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44574120/