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.

  1. go post-build actions , add execute set of scripts
  2. add build step -> execute apache ant
  3. make sure have ant installed on machine or configured in jenkins management automatic installation
  4. run following ant script:

<property environment="env"/> <property name="ws" value="${env.workspace}"/> <delete file="${ws}\${file_name}"/>

good luck!


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -