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