History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2110
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robin Shen
Reporter: Bartlomiej Grabowski
Votes: 4
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

The fields related to the Build Cleanup Strategy and Artifact Cleanup Strategy do not support scripting. It should be possible to enter scripts into these fields.

Created: 04/Jul/14 09:00 AM   Updated: 04/Jul/14 11:51 PM
Component/s: None
Affects Version/s: 5.1.20
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Linux


 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [04/Jul/14 11:10 AM]
These fields can be scripted already in 5.1.20. Please check it.

Bartlomiej Grabowski [04/Jul/14 11:34 AM]
We have 5.1.20 - Sat Apr 05 15:38:54 CEST 2014 version.

In Advance Settings for build we have the following options:
Build Cleanup Strategy:
- Do not clean up builds automatically
- Reserve builds by day
- Reserve builds by count

Artifacts Cleanup Strategy:
- Reserve artifacts for specified number of builds
- Do not clean up builds automatically
- Reserve artifacts for specified number of days

We want to execute our groovy script. We do not want to set number of day/number of build e.g vars.get("number_of_day"), we know that it is possible. We want to execute multiline script, which will be execute after build finished, so we want to add fourth option for example:

-Execute script,

and we enter script in text field.

Robin Shen [04/Jul/14 11:49 AM]
You can actually input multiline scripts there. Just click on the small multiline icon at left side of the input box. Then you can input any script you want as long as it is enclosed inside:
${...}

Every text field (except those explicitly declared to be a script) can accept script this way.

Bartlomiej Grabowski [04/Jul/14 02:01 PM]
OK. If I setBuild Cleanup Strategy Reserve Count to e.g 10, when this script will be executed? After 10 build? For each build above 10?

Robin Shen [04/Jul/14 11:51 PM]
The script gets called whenever QB calls the field getDays(), so it is mainly used to control different cleanup days for different inherited configurations. It does not have the semantic that it only get executed after build is cleaned up, etc. If you'd like to execute certain scripts upon build cleanup finish event, you may create your own maintenance configuration to run separate scritps without relying on the built-in cleanup policy.