【发布时间】:2022-05-28 16:02:07
【问题描述】:
我正在尝试让 Elastic Beanstalk(Amazon Linux 2、Node.js 16)运行一些预部署挂钩。我正在使用 .ebextensions 在 /opt/elasticbeanstalk/hooks/ 中创建一个挂钩。
在 .ebextensions 中,我有一个文件 04_use_yarn.config:
files:
\"/opt/elasticbeanstalk/hooks/appdeploy/pre/49yarn.sh\":
mode: \"000775\"
owner: root
group: users
content: |
#!/bin/bash
# <Contents of the script I\'m trying to run>
当 SSH 进入实例时,我可以看到 /opt/elasticbeanstalk/hooks/appdeploy/pre/ 中的 49yarn.sh 文件已正确生成。但是在部署过程中,我看到它记录了 \"[警告] 跳过 /opt/elasticbeanstalk/hooks/ 下的钩子脚本\"。我找不到任何关于是什么让它跳过该目录中的钩子的文档。
我怎样才能让它不跳过我的钩子?
以下是来自 eb-engine.log 的相关日志:
2022/05/26 20:28:29.538686 [INFO] Executing instruction: StageApplication
2022/05/26 20:28:30.060239 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/05/26 20:28:30.060268 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2022/05/26 20:28:36.070529 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2022/05/26 20:28:36.176851 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2022/05/26 20:28:36.176873 [WARN] skipping hooks scripts under /opt/elasticbeanstalk/hooks/
2022/05/26 20:28:36.176890 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2022/05/26 20:28:36.176934 [INFO] The dir .platform/hooks/prebuild/ does not exist
2022/05/26 20:28:36.176946 [INFO] Finished running scripts in /var/app/staging/.platform/hooks/prebuild
标签: amazon-web-services amazon-ec2 amazon-elastic-beanstalk amazon-linux-2