Ejemplo n.º 1
0
 /**
  * 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);
     });
 }
Ejemplo n.º 2
0
 /**
  * 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')));
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 private function runCommandList($commandList)
 {
     $this->info("Will run following commands:");
     foreach ($commandList as $command) {
         $this->info($command);
     }
     \SSH::run($commandList);
 }