php Phing exit task

1.2k views Asked by At

I have added task to build.xml to check certain condition for deployment e.g require os version and fail if requirements are not meet . e. g

<fail message="Required OS: '${deploy.require_os_version}' does not match with: '${remote_os}'"/>

Which is working but this outputs the whole error stack. Is there better way to send build failure signal and exit with decent error message ?

1

There are 1 answers

2
Courtney Miles On

I had the same question. I think the only solution is to nest your tasks in an if/then/else to ensure the failure condition leads to an <echo> and then make sure you have no tasks defined after the if block.

When you think about it, this is perhaps more programmatically correct than using a task to force an early exit under expected conditions.