set('remote_user', 'chris') ->set('hostname', 'caloriethingy.com') ->set('deploy_path', '/var/www/calorie') ->set('environment', 'Production') ->set('labels', ['env' => 'prod']); host('test.calorie') ->set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction') ->set('remote_user', 'chris') ->set('deploy_path', '/var/www/test.calorie') ->set('environment', 'Testing') ->set('labels', ['env' => 'test']); // Tasks task('init-app', function () { run('cd {{release_or_current_path}} && {{bin/php}} init --env={{environment}} --overwrite=n'); }); desc('Restart yii queue workers'); task('yii:queue:restart', function () { run('systemctl restart calorie-queue@*'); }); task('deploy:prod', function() { invoke('yii:queue:restart'); })->select('env=prod'); // Hooks after('deploy:vendors', 'init-app'); after('deploy:failed', 'deploy:unlock'); after('deploy', 'deploy:prod');