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