我将从 Envoyer 迁移出去AWS 代码部署以自动部署我的 Laravel 应用程序。
所以我将其添加到我的 afterInstall 脚本中:
cd /project directory
composer install
if [ -f artisan ]
then
php artisan migrate --force
fi
if [ -f artisan ]
then
php artisan config:cache
php artisan queue:restart
fi
但是部署失败并出现此错误
MessageScript at specified location: scripts/after-install.sh run as user user failed with exit code 1 Log TailLifecycleEvent - AfterInstall Script - scripts/after-install.sh [stderr]No passwd entry for user 'user'
这很奇怪。我创建的 AMI 实例已经具有默认用户登录以及 ubuntu sudoers :
grep -Po '^sudo.+:\K.*$' /etc/group
ubuntu,forge
那么为什么它要求输入密码呢?
最佳答案
我必须更改 appspec 文件中的 runAs
部分
in the script specified in "location".
AfterInstall:
- location: scripts/after-install.sh
runas: forge // used to be 'user'
关于laravel - 安装 whoami 问题后部署 AWS 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51645339/