Re: How to get publisher access to the build label?
Antoine Levy-Lambert <[email protected]>
| Newsgroups | gmane.comp.java.cruise-control.user |
|---|---|
| Message-ID | <[email protected]> |
On 6/25/2010 3:01 PM, bwawok wrote:
> I am trying to make a publisher that does a git tag with the current label.
>
> I am close, but need access to the label var. What I have looks like:
>
>
> <publishers>
> <onsuccess>
> <execute command="gittag.sh ${project.name} ${label}" />
> </onsuccess>
> </publishers>
>
I do not know how it works if you are using the execute publisher.
I have written a custom publisher in java which finds the label using a
class called XMLLogHelper which is in the API of CruiseControl.
Regards,
Antoine
public void publish(Element cruisecontrolLog) {
if (!active) {
LOG
.info("Labeling is not active; the project will not
be labeled.");
return;
}
XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
LOG.debug("viewpath is " + viewpath);
String label = null;
try {
label = helper.getCruiseControlInfoProperty("label");
LOG.debug("label is " + String.valueOf(label));
ViewParser viewParser = new LabelingViewParser(viewpath
.getAbsolutePath());
createLabelType(viewParser, label);
createLabel(viewParser, label);
if (lock) {
lockLabel(viewParser, label);
}
} catch (Exception e) {
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo