Amazon Web Services> CodeDeploy> BitBucket>我的nodejs Appspec.yml已损坏

我试图得到一个非常简单的nodejs应用程序来通过我的设置(BitBucket到AWS),我可以得到默认的例子工作:

https://github.com/awslabs/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux

但是,这个例子是在Apache,httpd,所以当我试图改变appspec.yml的nodejs,设置刹车。 这是我的appspec.yml:

version: 0.0 os: linux files: - source: / destination: /var/www/app hooks: BeforeInstall: - location: scripts/install_dependencies timeout: 300 runas: root - location: scripts/start_server timeout: 300 runas: root 

install_dependencies:

 #!/bin/bash yum install -y nodejs npm npm install 

START_SERVER:

 #!/bin/bash node server.js 

我从ec2事件日志和其他地方找出它。 这是我有什么:

appspec.yml

 version: 0.0 os: linux files: - source: / destination: /tmp/ hooks: AfterInstall: - location: scripts/install_dependencies timeout: 100 runas: root ApplicationStart: - location: scripts/start_server timeout: 100 runas: root 

install_dependencies:

 #!/bin/bash cd /tmp/ curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - yum install -y gcc-c++ make yum install -y nodejs npm npm install -g pm2 npm install 

对于start_server,停止并删除httpd。 然后开始pm2。 那么与“node server.js”的问题是,它永远不会解决。

START_SERVER:

 #!/bin/bash cd /tmp/ isExistApp = `pgrep httpd` if [[ -n $isExistApp ]]; then service httpd stop fi yum remove -y httpd pm2 delete all pm2 start server.js