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