jenkins - How to delete a file before build abort in a critical section with ANT? -
hy guys!
i delete file if build abort.
this critical section :
<touch file="path/lockfile.txt" /> <unzip src="path/archive.zip" dest="path/toto"/>
so, if build abort during <unzip>
want delete lockfile.txt
how can this?
don't hesitate ask more details lot :) !
if we're talking on job's level - add post build operation remove file. way builds aborted (due timeout or other reason) finishes build section , moving post build. ensure deletion of file under same session\workspace.
- go post-build actions , add execute set of scripts
- add build step -> execute apache ant
- make sure have ant installed on machine or configured in jenkins management automatic installation
- run following ant script:
<property environment="env"/> <property name="ws" value="${env.workspace}"/> <delete file="${ws}\${file_name}"/>
good luck!
Comments
Post a Comment