|
@@ 159-170 (lines=12) @@
|
| 156 |
|
/** |
| 157 |
|
* Enable a maintenance page for the given environment using the maintenance:enable Capistrano task. |
| 158 |
|
*/ |
| 159 |
|
public function enableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) { |
| 160 |
|
$name = $environment->getFullName(); |
| 161 |
|
$command = $this->getCommand('maintenance:enable', 'web', $environment, null, $log); |
| 162 |
|
$command->run(function($type, $buffer) use($log) { |
| 163 |
|
$log->write($buffer); |
| 164 |
|
}); |
| 165 |
|
if(!$command->isSuccessful()) { |
| 166 |
|
$this->extend('maintenanceEnableFailure', $environment, $log); |
| 167 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 168 |
|
} |
| 169 |
|
$log->write(sprintf('Maintenance page enabled on "%s"', $name)); |
| 170 |
|
} |
| 171 |
|
|
| 172 |
|
/** |
| 173 |
|
* Disable the maintenance page for the given environment using the maintenance:disable Capistrano task. |
|
@@ 175-186 (lines=12) @@
|
| 172 |
|
/** |
| 173 |
|
* Disable the maintenance page for the given environment using the maintenance:disable Capistrano task. |
| 174 |
|
*/ |
| 175 |
|
public function disableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) { |
| 176 |
|
$name = $environment->getFullName(); |
| 177 |
|
$command = $this->getCommand('maintenance:disable', 'web', $environment, null, $log); |
| 178 |
|
$command->run(function($type, $buffer) use($log) { |
| 179 |
|
$log->write($buffer); |
| 180 |
|
}); |
| 181 |
|
if(!$command->isSuccessful()) { |
| 182 |
|
$this->extend('maintenanceDisableFailure', $environment, $log); |
| 183 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 184 |
|
} |
| 185 |
|
$log->write(sprintf('Maintenance page disabled on "%s"', $name)); |
| 186 |
|
} |
| 187 |
|
|
| 188 |
|
/** |
| 189 |
|
* Check the status using the deploy:check capistrano method |
|
@@ 386-397 (lines=12) @@
|
| 383 |
|
* Also cleans up and generates new error pages. |
| 384 |
|
* @param DeploynautLogFile $log |
| 385 |
|
*/ |
| 386 |
|
public function rebuild(DNEnvironment $environment, $log) { |
| 387 |
|
$name = $environment->getFullName(); |
| 388 |
|
$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log); |
| 389 |
|
$command->run(function($type, $buffer) use($log) { |
| 390 |
|
$log->write($buffer); |
| 391 |
|
}); |
| 392 |
|
if(!$command->isSuccessful()) { |
| 393 |
|
$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput())); |
| 394 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 395 |
|
} |
| 396 |
|
$log->write(sprintf('Rebuild of "%s" done', $name)); |
| 397 |
|
} |
| 398 |
|
|
| 399 |
|
/** |
| 400 |
|
* Extracts a *.sspak file referenced through the passed in $dataTransfer |