Minor fixes
This commit is contained in:
parent
4a43c53e07
commit
82b3cbc246
3 changed files with 53 additions and 3 deletions
|
@ -65,16 +65,18 @@ class RebuildServer extends Command
|
|||
public function handle()
|
||||
{
|
||||
if ($this->option('all')) {
|
||||
$servers = Server::with('node', 'option.variables')->get();
|
||||
$servers = Server::all();
|
||||
} elseif ($this->option('node')) {
|
||||
$servers = Server::with('node', 'option.variables')->where('node_id', $this->option('node'))->get();
|
||||
$servers = Server::where('node_id', $this->option('node'))->get();
|
||||
} elseif ($this->option('server')) {
|
||||
$servers = Server::with('node', 'option.variables')->where('id', $this->option('server'))->get();
|
||||
$servers = Server::where('id', $this->option('server'))->get();
|
||||
} else {
|
||||
$this->error('You must pass a flag to determine which server(s) to rebuild.');
|
||||
return;
|
||||
}
|
||||
|
||||
$servers->load('node', 'service', 'option.variables', 'pack');
|
||||
|
||||
$this->line('Beginning processing, do not exit this script.');
|
||||
$bar = $this->output->createProgressBar(count($servers));
|
||||
$results = collect([]);
|
||||
|
@ -98,6 +100,11 @@ class RebuildServer extends Command
|
|||
'image' => $server->image,
|
||||
'env|overwrite' => $environment->pluck('value', 'variable')->merge(['STARTUP' => $server->startup]),
|
||||
],
|
||||
'service' => [
|
||||
'type' => $server->service->folder,
|
||||
'option' => $server->option->tag,
|
||||
'pack' => ! is_null($server->pack) ? $server->pack->uuid : null,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue