/** * Execute the console command. * * @return mixed */ public function fire() { $commands = array('cd /home/elegefacil/web/elegefacil.com/', 'php artisan down', 'php artisan clear-compiled', 'git pull origin master', 'php -d memory_limit=-1 /usr/bin/composer install --no-scripts', 'php artisan migrate', 'php artisan optimize', 'php artisan up'); SSH::run($commands, function ($line) { Log::info($line); }); }
/** * Execute the console command. * * @return mixed */ public function fire() { $packageName = 'laravel-deploy'; $appName = \Config::get("{$packageName}::application-name"); $basePath = \Config::get("{$packageName}::base-path"); $appPath = "{$basePath}/{$appName}/current"; echo "Running: " . 'LARAVEL_ENV=production ' . $this->argument('remoteCommand') . " inside {$appPath}\n"; \SSH::run(array("cd {$appPath}", "pwd", "LARAVEL_ENV=production " . $this->argument('remoteCommand'))); }
public function pull() { if ($this->auth()) { $payload = json_decode(Input::get("payload")); // only do this on master if ($payload["ref"] != "refs/heads/master") { return; } $forced = $payload["forced"] ? " (forced)" : ""; $git = $payload["forced"] ? "git pull origin master -- force" : "git pull origin master"; // log updates Log::info("[git] updating master from {$payload["before"]} to {$payload["after"]}" . $forced); // update the repo SSH::run(["cd " . base_path(), $git]); return; } }
private function runCommandList($commandList) { $this->info("Will run following commands:"); foreach ($commandList as $command) { $this->info($command); } \SSH::run($commandList); }