| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function perform() { |
||
| 22 | echo "[-] CreateEnvJob starting" . PHP_EOL; |
||
| 23 | // This is a bit icky, but there is no easy way of capturing a failed deploy by using the PHP Resque |
||
| 24 | try { |
||
| 25 | $envCreate = DNCreateEnvironment::get()->byId($this->args['createID']); |
||
| 26 | if(!($envCreate && $envCreate->exists())) { |
||
| 27 | throw new RuntimeException(sprintf('Could not find create environment record %s', $args['createID'])); |
||
| 28 | } |
||
| 29 | |||
| 30 | // This will throw and exception if it fails. |
||
| 31 | $envCreate->createEnvironment(); |
||
| 32 | |||
| 33 | } catch(Exception $e) { |
||
| 34 | echo "[-] CreateEnvJob failed" . PHP_EOL; |
||
| 35 | throw $e; |
||
| 36 | } |
||
| 37 | $this->updateStatus('Finished'); |
||
| 38 | echo "[-] CreateEnvJob finished" . PHP_EOL; |
||
| 39 | } |
||
| 40 | |||
| 64 |