Inheritance: extends Illuminate\Database\Eloquent\Model, use trait Illuminate\Database\Eloquent\SoftDeletes, use trait REBELinBLUE\Deployer\Traits\BroadcastChanges
コード例 #1
0
 public function run()
 {
     DB::table('servers')->delete();
     Server::create(['name' => 'Web VM', 'ip_address' => '192.168.33.50', 'user' => 'deploy', 'path' => '/var/www', 'project_id' => 1, 'deploy_code' => true]);
     Server::create(['name' => 'Cron VM', 'ip_address' => '192.168.33.60', 'user' => 'deploy', 'path' => '/var/www', 'project_id' => 1, 'deploy_code' => true]);
     Server::create(['name' => 'Database VM', 'ip_address' => '192.168.33.70', 'user' => 'deploy', 'path' => '/home/deploy', 'project_id' => 1, 'deploy_code' => false]);
 }
コード例 #2
0
 /**
  * Execute the command.
  */
 public function handle()
 {
     $this->server->status = Server::TESTING;
     $this->server->save();
     $key = tempnam(storage_path('app/'), 'sshkey');
     file_put_contents($key, $this->server->project->private_key);
     try {
         $process = new Process('TestServerConnection', ['project_path' => $this->server->clean_path, 'test_file' => time() . '_testing_deployer.txt', 'test_directory' => time() . '_testing_deployer_dir']);
         $process->setServer($this->server, $key)->run();
         if (!$process->isSuccessful()) {
             $this->server->status = Server::FAILED;
         } else {
             $this->server->status = Server::SUCCESSFUL;
         }
     } catch (\Exception $error) {
         $this->server->status = Server::FAILED;
     }
     $this->server->save();
     unlink($key);
 }
コード例 #3
0
 public function run()
 {
     DB::table('servers')->delete();
     Server::create(['name' => 'Web VM', 'ip_address' => '192.168.33.50', 'user' => 'deploy', 'path' => '/var/www', 'project_id' => 1]);
     Server::create(['name' => 'Cron VM', 'ip_address' => '192.168.33.60', 'user' => 'deploy', 'path' => '/var/www', 'project_id' => 1]);
     // Server::create([
     //     'name'       => 'DB VM',
     //     'ip_address' => '192.168.33.70',
     //     'user'       => 'deploy',
     //     'path'       => '/var/www',
     //     'project_id' => 1
     // ]);
 }