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