我有一个简单的测试Angular 应用程序.我正在学习AWS代码管道的教程,但在代码部署阶段失败了. Tutorial I am following My angular application GitHub link

代码生成成功.您可以在提供的GitHub链接中看到Buildspec.yml文件.但是,代码部署阶段失败,在BeForeBlockCommunications阶段出现以下错误.

CodeDeploy agent was not able to receive the lifecycle event. Check the CodeDeploy agent logs on your host and make sure the agent is running and can connect to the CodeDeploy server.

我知道这是一个与政策有关的问题.但是,我已经启用了对我的EC2计算机的完全访问.以下是当前启用的策略列表.我是不是漏掉了什么政策?

enter image description here

下面是我正在使用的appspec.yml文件.我在这份文件中也遗漏了什么吗??

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html/
hooks:
  BeforeInstall:
    - location: scripts/remove_root_dir
      timeout: 900
      runas: root
  ApplicationStart:
    - location: scripts/install_dependencies
      timeout: 300
      runas: root
    - location: scripts/start_server
      timeout: 300
      runas: root
  ApplicationStop:
    - location: scripts/stop_server
      timeout: 300
      runas: root

推荐答案

判断您的EC2机器上是否启用了CodeDeploy代理.您还可以登录到EC2计算机并执行以下步骤来手动安装CodeDeploy代理.

sudo yum update
sudo yum install ruby
sudo yum install wget
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto

Angular相关问答推荐

使用当前选定的选项创建IF语句

带有搜索功能的CDK-VIRTUAL-SCROLL-VIEPORT不显示该值

笔刷Angular 为17

Angular 如何渲染ngFor?

属性';apiUrl';在我的Angular 应用程序上不存在类型';{}';错误

为什么动画只触发一次?

使用 RXJS 进行空闲/不活动跟踪

如何使用指令以Angular 传递默认值

Angular 项目构建仅在 GitHub Actions 上失败

为什么 Angular2 (click) 事件没有在

如何在 bootstrap Angular 2 应用程序时调用休息 api

找不到模块'@angular/compiler'

Angular Material 模态对话框周围的空白

实现autocomplete功能

Angular将 Select 值转换为 int

如何使用 Angular 6 工作的 ngModel 创建自定义输入组件?

Lint 错误:实现生命周期挂钩接口

提交后在Angular 2中重置表单

将 [NgStyle] 与条件组合(if..else)

如何在 Angular CLI 6: angular.json 中添加 Sass 编译?