I'm migrating away from Envoyer to AWS code deploy to auto-deploy my Laravel app.
So I added this to my afterInstall script:
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
But the deployment fails with this error
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'
which is weird. The AMI instance I've created already has the default user login as well as ubuntu as sudoers:
grep -Po '^sudo.+:\K.*$' /etc/group
ubuntu,forge
So why is it asking for a password?