|
@@ 191-202 (lines=12) @@
|
| 188 |
|
/** |
| 189 |
|
* Enable a maintenance page for the given environment using the maintenance:enable Capistrano task. |
| 190 |
|
*/ |
| 191 |
|
public function enableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) { |
| 192 |
|
$name = $environment->getFullName(); |
| 193 |
|
$command = $this->getCommand('maintenance:enable', 'web', $environment, null, $log); |
| 194 |
|
$command->run(function($type, $buffer) use($log) { |
| 195 |
|
$log->write($buffer); |
| 196 |
|
}); |
| 197 |
|
if(!$command->isSuccessful()) { |
| 198 |
|
$this->extend('maintenanceEnableFailure', $environment, $log); |
| 199 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 200 |
|
} |
| 201 |
|
$log->write(sprintf('Maintenance page enabled on "%s"', $name)); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
/** |
| 205 |
|
* Disable the maintenance page for the given environment using the maintenance:disable Capistrano task. |
|
@@ 207-218 (lines=12) @@
|
| 204 |
|
/** |
| 205 |
|
* Disable the maintenance page for the given environment using the maintenance:disable Capistrano task. |
| 206 |
|
*/ |
| 207 |
|
public function disableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) { |
| 208 |
|
$name = $environment->getFullName(); |
| 209 |
|
$command = $this->getCommand('maintenance:disable', 'web', $environment, null, $log); |
| 210 |
|
$command->run(function($type, $buffer) use($log) { |
| 211 |
|
$log->write($buffer); |
| 212 |
|
}); |
| 213 |
|
if(!$command->isSuccessful()) { |
| 214 |
|
$this->extend('maintenanceDisableFailure', $environment, $log); |
| 215 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 216 |
|
} |
| 217 |
|
$log->write(sprintf('Maintenance page disabled on "%s"', $name)); |
| 218 |
|
} |
| 219 |
|
|
| 220 |
|
/** |
| 221 |
|
* Check the status using the deploy:check capistrano method |
|
@@ 418-429 (lines=12) @@
|
| 415 |
|
* Also cleans up and generates new error pages. |
| 416 |
|
* @param DeploynautLogFile $log |
| 417 |
|
*/ |
| 418 |
|
public function rebuild(\DNEnvironment $environment, $log) { |
| 419 |
|
$name = $environment->getFullName(); |
| 420 |
|
$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log); |
| 421 |
|
$command->run(function($type, $buffer) use($log) { |
| 422 |
|
$log->write($buffer); |
| 423 |
|
}); |
| 424 |
|
if(!$command->isSuccessful()) { |
| 425 |
|
$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput())); |
| 426 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 427 |
|
} |
| 428 |
|
$log->write(sprintf('Rebuild of "%s" done', $name)); |
| 429 |
|
} |
| 430 |
|
|
| 431 |
|
/** |
| 432 |
|
* Extracts a *.sspak file referenced through the passed in $dataTransfer |