Skip to content

Instantly share code, notes, and snippets.

@zvercodebender
Last active October 30, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zvercodebender/4758dd04429da5b8cb41 to your computer and use it in GitHub Desktop.
Save zvercodebender/4758dd04429da5b8cb41 to your computer and use it in GitHub Desktop.
A small XL Deploy CLI script to clean up and archive tasks
import com.xebialabs.deployit.engine.api.execution.TaskExecutionState as TaskExecutionState
taskList = task2.getAllCurrentTasks()
for task in taskList:
if task.state == TaskExecutionState.EXECUTED :
print "Archive : %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
task2.archive( task.id )
elif task.state == TaskExecutionState.FAILED :
print "Canceling: %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
task2.cancel( task.id )
else:
print "---------: %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
# End if
# End for
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment