currentBuild.number is also null?
On 05.12.2013, at 02:04, Bill Wonch <[email protected]> wrote:
> Hi everyone -
>
> I've got the following code:
>
> import hudson.model.*;
> import hudson.util.*;
>
> def thr = Thread.currentThread();
> def currentBuild = thr?.executable;
>
> def buildNumberField = "BUILD_NUMBER"
> def resolver = currentBuild.buildVariableResolver
> def buildNumber = resolver.resolve(buildNumberField)
>
> out.println ("Build number is:" + buildNumber)
>
> def mavenVersion =
> currentBuild.getParent().getModules().toArray()[0].getVersion();
> def mavenFullName =
> currentBuild.getParent().getModules().toArray()[0].getName();
> def mavenName =
> mavenFullName.substring(mavenFullName.indexOf(':')+1,mavenFullName.length());
> def mavenSite = "http://jenkins/sites/" + mavenName + "/" + mavenVersion +
> "/" + buildNumber + "/";
>
> def siteParamAction = new hudson.model.ParametersAction(new
> hudson.model.StringParameterValue("MAVEN_SITE", mavenSite));
> currentBuild.addAction(siteParamAction);
>
> For some reason buildNumber results in null. I've tried doing this a number
> of ways and still no luck. Can anyone provide some advice?
>
> Thanks!
> Bill
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.