provision failure checks
This commit is contained in:
@@ -35,10 +35,21 @@ class ProvisionServer implements ShouldQueue, ShouldBeEncrypted
|
||||
|
||||
// Download the provision script and execute it
|
||||
// The script will run in the background
|
||||
$ssh->execute("wget --quiet --output-document=provision.sh \"{$provisionScriptUrl}\" && chmod +x provision.sh && ./provision.sh &");
|
||||
$result = $ssh->execute("wget --quiet --output-document=provision.sh \"{$provisionScriptUrl}\" && chmod +x provision.sh && ./provision.sh &");
|
||||
logger('executing script on server');
|
||||
logger("wget --quiet --output-document=provision.sh \"{$provisionScriptUrl}\" && chmod +x provision.sh && ./provision.sh &");
|
||||
|
||||
if (! $result->isSuccessful()) {
|
||||
logger('failed to execute script on server');
|
||||
logger($result->getOutput());
|
||||
logger($result->getErrorOutput());
|
||||
logger($result->getExitCode());
|
||||
$this->server->update([
|
||||
'status' => ServerStatus::PROVISIONING_FAILED,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->server->update([
|
||||
'status' => ServerStatus::PROVISIONING,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user