i have set up a laravel app with continuous deployment ( travis ci ) on heroku .
the project's composer.json has a scripts
attribute as follows :
"scripts": {
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"@php artisan clear-compiled",
"@php artisan optimize",
"@php artisan migrate --force",
"@php artisan passport:install --force",
"@php artisan route:cache",
"@php artisan config:cache"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"heroku config:set APP_KEY=$(php artisan key:generate --show)"
]
}
everything works fine , the project gets deployed normally but , the APP_KEY config var is not set up on heroku by post-create-project-cmd
.
(i have heroku build pack toolbet added to my heroku app)
why isn't it working as an automated script , but it's working if run the command locally ?