脚本appspe.yml:
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/
permissions:
- object: /home/ubuntu/
owner: root
group: root
mode: 777
hooks:
BeforeInstall:
- location: scripts/install_dependencies.sh
timeout: 300
runas: root
- location: scripts/start_server.sh
timeout: 300
runas: root
ApplicationStop:
- location: scripts/stop_server.sh
timeout: 300
runas: root
不幸的是,它没有将文件复制到/home/ubuntu/
目录。有了这个,我通过codedeploy部署时收到以下错误
LifecycleEvent - BeforeInstall脚本 - scripts / install_dependencies.sh脚本 - scripts / start_server.sh [stderr] cp:不能统计'scripts / gunicorn.service':没有这样的文件或目录[stderr]无法启动gunicorn.service:Unit gunicorn。无法提供服务。 [stderr]无法执行操作:没有这样的文件或目录[stderr]无法重启gunicorn.service:找不到Unit gunicorn.service。 [stderr] cp:不能统计'scripts / LIMA':没有这样的文件或目录[stderr] ln:无法创建符号链接'/ etc / nginx / sites-enabled / LIMA':文件存在[stderr]错误:错误的端口
这里出了什么问题?
您的错误似乎属于以下类别:
我希望这有帮助。
我遇到了同样的问题。 当我将“BeforeInstall”挂钩中的命令移动到“AfterInstall”挂钩时,它对我有效。