diff --git a/README.md b/README.md index a92bf06..a893f4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel 5 - 9.x Task Scheduler with Elastic Beanstalk +# Laravel 5 - 10.x Task Scheduler with Elastic Beanstalk *Ensure one instance in an Elastic Beanstalk environment is running Laravel's Scheduler* diff --git a/composer.json b/composer.json index 0d9ae80..58b72f1 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "foxxmd/laravel-elasticbeanstalk-cron", + "name": "cyber-duck/laravel-elasticbeanstalk-cron", "description": "Ensure only one Laravel instance is running CRON jobs in an EB environment", "type": "library", "license": "MIT", @@ -10,8 +10,8 @@ } ], "require": { - "illuminate/support": "5 - 9", - "illuminate/console": "5 - 9", + "illuminate/support": "5 - 10", + "illuminate/console": "5 - 10", "aws/aws-sdk-php": "^3.26", "lstrojny/functional-php": "^1.17" }, diff --git a/src/.platform/hooks/postdeploy/02scheduler.sh b/src/.platform/hooks/postdeploy/02scheduler.sh index bb7c850..c32f79a 100755 --- a/src/.platform/hooks/postdeploy/02scheduler.sh +++ b/src/.platform/hooks/postdeploy/02scheduler.sh @@ -3,7 +3,7 @@ mkdir -p /home/webapp ; chown -R webapp:webapp /home/webapp # Adds a cron entry that checks for leader selection every 5 minutes -sudo -u webapp bash -c ". /opt/elasticbeanstalk/deployment/envvars ; /usr/bin/php artisan system:start:leaderselection" +sudo -u webapp bash -c "/usr/bin/php artisan system:start:leaderselection" # Does an initial leader selection check -sudo -u webapp bash -c ". /opt/elasticbeanstalk/deployment/envvars ; /usr/bin/php artisan aws:configure:leader" +sudo -u webapp bash -c "/usr/bin/php artisan aws:configure:leader" diff --git a/src/Console/System/SetupLeaderSelectionCRONCommand.php b/src/Console/System/SetupLeaderSelectionCRONCommand.php index 9f7b198..212830a 100644 --- a/src/Console/System/SetupLeaderSelectionCRONCommand.php +++ b/src/Console/System/SetupLeaderSelectionCRONCommand.php @@ -63,7 +63,7 @@ public function handle() // (this link is for AL1, AL2 need a workaround to get the same envvars file, see .platform folder) file_put_contents( '/tmp/crontab.txt', - $output . "*/$interval * * * * . /opt/elasticbeanstalk/deployment/envvars &&" . + $output . "*/$interval * * * * " . " /usr/bin/php $path aws:configure:leader >> /dev/null 2>&1" . PHP_EOL ); diff --git a/src/Console/System/SetupSchedulerCommand.php b/src/Console/System/SetupSchedulerCommand.php index 540c185..f4ce6c9 100644 --- a/src/Console/System/SetupSchedulerCommand.php +++ b/src/Console/System/SetupSchedulerCommand.php @@ -54,7 +54,7 @@ public function handle() // using opt..envvars makes sure that environmental variables are loaded before we run artisan // http://georgebohnisch.com/laravel-task-scheduling-working-aws-elastic-beanstalk-cron/ // (this link is for AL1, AL2 need a workaround to get the same envvars file, see .platform folder) - file_put_contents('/tmp/crontab.txt', $output . '* * * * * . /opt/elasticbeanstalk/deployment/envvars && /usr/bin/php ' . $path . ' schedule:run >> /dev/null 2>&1' . PHP_EOL); + file_put_contents('/tmp/crontab.txt', $output . '* * * * * /usr/bin/php ' . $path . ' schedule:run >> /dev/null 2>&1' . PHP_EOL); echo exec('crontab /tmp/crontab.txt'); }