@setup $domain = 'voice2020'; $stagingDirectory = "{$domain}/"; $productionDirectory = "{$domain}/"; function logMessage($message) { return "echo '\033[32m" .$message. "\033[0m';\n"; } @endsetup @servers(['local' => '127.0.0.1', 'remote' => 'byvoicebru@ssh.cluster020.hosting.ovh.net']) @task('deploy', ['on' => 'remote', 'confirm' => true]) {{ logMessage("⛳️ Target " . $stagingDirectory . " & down project") }} cd {{ $stagingDirectory }} php artisan down {{ logMessage("📥 Git pull...") }} git pull {{ logMessage("🚚 Running Composer...") }} composer update {{ logMessage("🚽 Clearing cache...") }} php artisan route:clear php artisan config:clear php artisan cache:clear php artisan view:cache php artisan up {{ logMessage("🚀 Application deployed!") }} @endtask @task('productionDeploy', ['on' => 'remote', 'confirm' => true]) {{ logMessage("⛳️ Target " . $productionDirectory . " & down project") }} cd {{ $productionDirectory }} php artisan down {{ logMessage("📥 Git pull...") }} git pull {{ logMessage("🚚 Running Composer...") }} composer update {{ logMessage("🚽 Clearing cache...") }} php artisan route:clear php artisan config:clear php artisan cache:clear php artisan view:cache php artisan up {{ logMessage("🚀 Application deployed!") }} @endtask