Re: How can I set the build description from a parameter?
Excellent, thank you! For future reference, my final solution is really simple: 1) In each job I have a string parameter named "Reason" with a default value of "Manual build". FYI, for each such job I have a matching "Nightly" job that is triggered every midnight-ish, all it does is trigger the main job with the Reason parameter set to "Nightly build", and I also have a system to accept CVS commit triggers and the details of those commits also get sent to the main job with the Reason parameter set to "CVS Change" and the details. 2) "Prepare an environment for the run" is checked (enabled). 3) "Evaluated Groovy script" contains one line: currentBuild.setDescription(currentBuild.buildVariableResolver.resolve("Rea son")) Voila! BTW, most of my jobs are matrix jobs, and so the slaves also end up executing this Groovy script, so I end up setting the description 4 times (1 master, 3 slaves) which annoys my sensibilities but is otherwise not a problem. Chris On 12/4/13 1:45 AM, "matthew.web...@diamond.ac.uk" wrote: >Here is the Groovy script I use, which gets the description from the log. >You can modify as required to use an environment variable (I think). >Matthew Webber > >// This Groovy script must be run using a Jenkins "Execute system Groovy >script" build step >// A previous step must write a line in the log of the form defined in >"pattern" below > >def currentBuild = Thread.currentThread().executable >def pattern = /^set-build-description: (.+)$/ > >// Parsing 20 most recent lines of the build log >log = currentBuild.getLog(20) >for (line in log) { >match = (line =~ pattern) > if (match) { > currentBuild.setDescription(match[0][1]) > out.println "[set-build-description.groovy] Build description was >set to: " + match[0][1] > break > } >} > >> -Original Message- >> From: jenkinsci-users@googlegroups.com >>[mailto:jenkinsci-users@googlegroups.com] On Behalf Of cscooper >> Sent: 04 December 2013 00:09 >> To: jenkinsci-users@googlegroups.com >> Subject: How can I set the build description from a parameter? >> >> I've got a parameterized matrix build, one of the parameters is called >> "Description" and in the "Prepare an environment for the run" section, >>under >> "Script Content", I have this: >> curl -G -s --data-urlencode "Description=$Description" >> "http://localhost:8080/job/$JOB_NAME/$BUILD_NUMBER/submitDescription"; >> this works great to set the description of the build according to the >> Description parameter, and do so early on in the build (I'm not as happy >> with the plugins that set the description at the end of the build). >> >> HOWEVER >> >> when the Matrix part of the job kicks in, this code gets executed again >>on >> my Linux box which chokes because it's only a slave so >>http://localhost:8080 >> doesn't mean anything. >> >> I thought about actually specifying the IP, so the "submitDescription" >>would >> go to the actual build server, but in the matrix build $JOB_NAME is now >> "Job/Matrix=linux" so the URL isn't right anyway. >> >> AND >> >> I've also got a Windows slave, and "curl" just completely confuses him. >> >> I tried writing an "if" statement in the "Script Content" - something >>like >> this: >> >> if [[ "$NODE_NAME" = "master" ]]; then >> curl -G blah blah blah >> fi >> >> but (1) Jenkins wasn't at all happy with that, and (2) even if Jenkins >> accepted it, my Windows slave would choke on it. >> >> * Is there a better way to set the build description from a parameter? >> * Is there a way to have Jenkins prepare the environment differently on >> different nodes? >> * Is there a trick to putting a value in "Script File Path" such that it >> runs correctly on both Windows and Linux slaves? >> * Is there something clever I can do with a Groovy script here? >> >> Thanks for any and all advice! >> Chris >> > >-- >This e-mail and any attachments may contain confidential, copyright and >or privileged material, and are for the use of the intended addressee >only. If you are not the intended addressee or an authorised recipient of >the addressee please notify us of receipt by returning the e-mail and do >not use, copy, retain, distribute or disclose the information in or >attached to the e-mail. >Any opinions expressed within this e-mail are those of the individual and >not necessarily of Diamond Light Source Ltd. >Diamond Light Source Ltd. cannot guarantee that this e-mail or any >attachments are free from viruses and we cannot accept liability for any >damage which you may sustain as a result of software viruses which may be >transmitted in or with the message. >Diamond Light Source Limited (company no. 4375679). Registered in England >and Wales with its registered office at Diamond House, Harwell Science >and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > > > >-- >You received this message because you are subscribed to the Google Groups >"Jenkins Users" group. >To unsubscribe from this group
Re: Setting "Started by" value?
Brilliant! I had read that section of the plugin page before but then forgot about it. Weird thing though Š loading that URL with cURL says: Scheduled polling of No git consumers for URI ssh://blah.blah/blah Is this just a bug that it finds a consumer, then says there aren't any? Thanks, Chris On 10/25/13 2:49 PM, "Daniel Beck" wrote: >Try this: > >https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Pushnotif >icationfromrepository > >Set the job to poll once a day or so ('H H * * *') to enable it to react >to that call. > >On 25.10.2013, at 22:23, cscooper wrote: > >> I have a post-commit hook in GIT that launches the associated Jenkins >>job by >> loading http://jenkins/job/buildWithParameters using cURL - the problem >>is >> that job says "Started by anonymous user" which, while accurate, is not >> entirely helpful. >> >> Is there a way to pass information in the URL so that Jenkins can >>accurately >> say "Started due to a GIT change"? Or any random "Started by XYZ"? >> >> I have seen suggestions that I can put the information in the console >>log, >> or some other parameter, but those aren't going to be as obvious as if >>I can >> put it in the "Started by" line. >> >> Thanks, >> Chris >> >> >> >> >> -- >> View this message in context: >>http://jenkins-ci.361315.n4.nabble.com/Setting-Started-by-value-tp4679454 >>.html >> Sent from the Jenkins users mailing list archive at Nabble.com. >> >> -- >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: git polling builds every 2 minutes, repository isn't changing - why?
The UI for setting the options in the 2.0 plugin is apparently drastically different from the UI of the 1.5 plugin … it's now got a label "Additional Behaviours" with a button "Add" that brings up a drop down menu. So, for example, where the 1.5 plugin shows you "Included Regions" and "Excluded Regions", the 2.0 plugin requires you to click on Add and select "Polling ignores commits in certain paths" at which point a sub-group appears in the UI that contains "Included Regions" and "Excluded Regions". Problem is, I've opened up all of the sub-groups available from the "Add" button, and none of them contain anything similar to "Fast remote polling". Chris From: Maneesh M P mailto:maneesh.po...@gmail.com>> Date: Thursday, October 24, 2013 12:29 PM To: "jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" mailto:jenkinsci-users@googlegroups.com>> Cc: Maneesh M P mailto:maneesh.po...@gmail.com>>, Chris Cooper mailto:chris.coo...@veranmedical.com>> Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Nope, I am using git version 1.5.0, I am sure that option will be available in 2.0 as well. You just have to click on the "Advanced" option right to "Repository browser". Please see the attached screenshot Thanks, Maneesh On Thursday, October 24, 2013 11:22:21 AM UTC-7, Chris Cooper wrote: Interesting … the configuration I have available looks NOTHING like that! I am up-to-date with Jenkins 1.536 and have the "Jenkins GIT client plugin" (version 1.4.5) and the "Jenkins GIT plugin" (version 2.0). In my job, in the "Source Code Management" section, one of the radio-button choices is for "Git". It lets me specify Repositories, Branches to build, Repository browser, and Additional Behaviours. None of the Additional Behaviours contain anything about remote polling either. Are you running git using some completely different method? Thanks, Chris From: Maneesh M P > Date: Thursday, October 24, 2013 11:51 AM To: "jenkins...@googlegroups.com" > Cc: Chris Cooper > Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Please see the attached screenshot .. It was taken from my job configuration. Thanks, Maneesh On Thursday, October 24, 2013 10:11:32 AM UTC-7, Chris Cooper wrote: I see people talking about git remote polling, but can't find the option anywhere to enable it. Can you point me to it? Thanks, Chris From: Maneesh M P Reply-To: "jenkins...@googlegroups.com" Date: Thursday, October 24, 2013 10:55 AM To: "jenkins...@googlegroups.com" Cc: Chris Cooper Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Have you tried git remote polling ? Thanks, Maneesh On Thursday, October 24, 2013 9:05:32 AM UTC-7, cscooper wrote: I'm starting the process of converting from cvs to git, and running into a strange issue. Right now, we have it set up so Jenkins polls git to see if anything changed (in the future I will try to get push notifications working) and for some reason it thinks the repository is always changing - so it builds every 2 minutes, day and night. The git repository is testing-only and I'm the only one who even has access to it, so I can guarantee it's not changing. If I look at the latest build (#727 from 10:00 am) and click on "Started by an SCM change", I see this: Started on Oct 24, 2013 10:00:11 AM Using strategy: Default [poll] Last Build Revision: revision 24e7blahblahblah4c85 (origin/master) Done. Took 0.66 sec Changes found and if I look at the build before that (#726 from 9:58 am) I see the exact same output (except the starting time and elapsed time changes). The revision HMAC is identical. I'm having other issues with this repository ( http://stackoverflow.com/questions/19569805/git-clone-followed-by-status-shows-untracked-files ) so I don't know if I'm using git wrong, or if svn2git created the repository wrong. Any ideas on this? Thanks, Chris -- View this message in context: http://jenkins-ci.361315.n4.nabble.com/git-polling-builds-every-2-minutes-repository-isn-t-changing-why-tp4679352.html Sent from the Jenkins users mailing list archive at Nabble.com. -- 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 jenkinsci-use...@googlegroups.com. 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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: git polling builds every 2 minutes, repository isn't changing - why?
Interesting … the configuration I have available looks NOTHING like that! I am up-to-date with Jenkins 1.536 and have the "Jenkins GIT client plugin" (version 1.4.5) and the "Jenkins GIT plugin" (version 2.0). In my job, in the "Source Code Management" section, one of the radio-button choices is for "Git". It lets me specify Repositories, Branches to build, Repository browser, and Additional Behaviours. None of the Additional Behaviours contain anything about remote polling either. Are you running git using some completely different method? Thanks, Chris From: Maneesh M P mailto:maneesh.po...@gmail.com>> Date: Thursday, October 24, 2013 11:51 AM To: "jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" mailto:jenkinsci-users@googlegroups.com>> Cc: Chris Cooper mailto:chris.coo...@veranmedical.com>> Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Please see the attached screenshot .. It was taken from my job configuration. Thanks, Maneesh On Thursday, October 24, 2013 10:11:32 AM UTC-7, Chris Cooper wrote: I see people talking about git remote polling, but can't find the option anywhere to enable it. Can you point me to it? Thanks, Chris From: Maneesh M P > Reply-To: "jenkins...@googlegroups.com" > Date: Thursday, October 24, 2013 10:55 AM To: "jenkins...@googlegroups.com" > Cc: Chris Cooper > Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Have you tried git remote polling ? Thanks, Maneesh On Thursday, October 24, 2013 9:05:32 AM UTC-7, cscooper wrote: I'm starting the process of converting from cvs to git, and running into a strange issue. Right now, we have it set up so Jenkins polls git to see if anything changed (in the future I will try to get push notifications working) and for some reason it thinks the repository is always changing - so it builds every 2 minutes, day and night. The git repository is testing-only and I'm the only one who even has access to it, so I can guarantee it's not changing. If I look at the latest build (#727 from 10:00 am) and click on "Started by an SCM change", I see this: Started on Oct 24, 2013 10:00:11 AM Using strategy: Default [poll] Last Build Revision: revision 24e7blahblahblah4c85 (origin/master) Done. Took 0.66 sec Changes found and if I look at the build before that (#726 from 9:58 am) I see the exact same output (except the starting time and elapsed time changes). The revision HMAC is identical. I'm having other issues with this repository ( http://stackoverflow.com/questions/19569805/git-clone-followed-by-status-shows-untracked-files ) so I don't know if I'm using git wrong, or if svn2git created the repository wrong. Any ideas on this? Thanks, Chris -- View this message in context: http://jenkins-ci.361315.n4.nabble.com/git-polling-builds-every-2-minutes-repository-isn-t-changing-why-tp4679352.html Sent from the Jenkins users mailing list archive at Nabble.com. -- 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 jenkinsci-use...@googlegroups.com. 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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: git polling builds every 2 minutes, repository isn't changing - why?
I see people talking about git remote polling, but can't find the option anywhere to enable it. Can you point me to it? Thanks, Chris From: Maneesh M P mailto:maneesh.po...@gmail.com>> Reply-To: "jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" mailto:jenkinsci-users@googlegroups.com>> Date: Thursday, October 24, 2013 10:55 AM To: "jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" mailto:jenkinsci-users@googlegroups.com>> Cc: Chris Cooper mailto:chris.coo...@veranmedical.com>> Subject: Re: git polling builds every 2 minutes, repository isn't changing - why? Have you tried git remote polling ? Thanks, Maneesh On Thursday, October 24, 2013 9:05:32 AM UTC-7, cscooper wrote: I'm starting the process of converting from cvs to git, and running into a strange issue. Right now, we have it set up so Jenkins polls git to see if anything changed (in the future I will try to get push notifications working) and for some reason it thinks the repository is always changing - so it builds every 2 minutes, day and night. The git repository is testing-only and I'm the only one who even has access to it, so I can guarantee it's not changing. If I look at the latest build (#727 from 10:00 am) and click on "Started by an SCM change", I see this: Started on Oct 24, 2013 10:00:11 AM Using strategy: Default [poll] Last Build Revision: revision 24e7blahblahblah4c85 (origin/master) Done. Took 0.66 sec Changes found and if I look at the build before that (#726 from 9:58 am) I see the exact same output (except the starting time and elapsed time changes). The revision HMAC is identical. I'm having other issues with this repository ( http://stackoverflow.com/questions/19569805/git-clone-followed-by-status-shows-untracked-files ) so I don't know if I'm using git wrong, or if svn2git created the repository wrong. Any ideas on this? Thanks, Chris -- View this message in context: http://jenkins-ci.361315.n4.nabble.com/git-polling-builds-every-2-minutes-repository-isn-t-changing-why-tp4679352.html Sent from the Jenkins users mailing list archive at Nabble.com. -- 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 jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>. 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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: CVS error "file was lost" in matrix build
Ok, I've updated JENKINS-17965, but since that issue was opened 6 months ago I'm guessing this is not a problem a lot of people are seeing? On 10/14/13 3:02 PM, "Michael Clarke" wrote: >Ok. I've not tried reproducing your issue (the plugin works fine for >me during development and on various different production servers I >manage) but the warning indicates that the Entries file used to track >filed doesn't match what's on the file system. Since you haven't >changed the files, I suspect something is going wrong with the way we >manage the entries file. Could you add some details about your system >to JENKINS-17965 (operating system, default file encoding, cvs server >version etc). > >Thanks >Michael > > >> On 14 Oct 2013, at 21:53, Chris Cooper >>wrote: >> >> Up-to-date: Jenkins 1.534 with Jenkins CVS Plug-in version 2.9 >> >>> On 10/14/13 2:46 PM, "Michael Clarke" >>>wrote: >>> >>> Which version of Jenkins and cvs-plugin are you using? >>> >>> Thanks >>> Michael >>> >>>> On 14 Oct 2013, at 21:44, cscooper >>>> wrote: >>>> >>>> We have a matrix job that runs fine except that when the master does >>>> that >>>> initial CVS update on the master prior to launching any of the matrix >>>> builds >>>> on slaves, it gives a CVS "file was lost" error for every file in the >>>> project. >>>> >>>> The job is parameterized with a boolean named DELETE_WORKSPACE which >>>>is >>>> set >>>> as the "Check parameter" for "Delete workspace before build starts" in >>>> the >>>> Build Environment. If I set DELETE_WORKSPACE to true, the build runs >>>> perfectly without any CVS errors which implies that my CVS >>>> authentication is >>>> correct. >>>> >>>> I tried running the CVS commands from the terminal window, and here's >>>> what I >>>> see. >>>> >>>> If I run the commands directly: >>>> 1) cvs checkout -P -d project project (this is what Jenkins does if >>>> DELETE_WORKSPACE is true) >>>> 2) cvs update -C -d -P project (this is what Jenkins does if >>>> DELETE_WORKSPACE is false) >>>> Both CVS commands run fine. >>>> >>>> If I let Jenkins run the first command by performing the build: >>>> 1) Run the Jenkins job with DELETE_WORKSPACE=true >>>> 2) cvs update -C -d -P project >>>> During the cvs update, CVS gives me a bunch of warnings about locally >>>> modified files being moved to temporary files. >>>> >>>> And wait, it gets stranger. If I do this: >>>> 1) Run the Jenkins job with DELETE_WORKSPACE=true >>>> 2) cvs status project >>>> 3) cvs update -C -d -P project >>>> Then I _don't_ get any warnings during the cvs update about locally >>>> modified >>>> files. >>>> >>>> So it looks like Jenkins is somehow leaving CVS in a strange state >>>> where it >>>> thinks my local files have been modified when they really haven't? >>>> >>>> Thanks, >>>> Chris >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> >>>>http://jenkins-ci.361315.n4.nabble.com/CVS-error-file-was-lost-in-matri >>>>x- >>>> build-tp4678897.html >>>> Sent from the Jenkins users mailing list archive at Nabble.com. >>>> >>>> -- >>>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >>>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: CVS error "file was lost" in matrix build
Up-to-date: Jenkins 1.534 with Jenkins CVS Plug-in version 2.9 On 10/14/13 2:46 PM, "Michael Clarke" wrote: >Which version of Jenkins and cvs-plugin are you using? > >Thanks >Michael > >> On 14 Oct 2013, at 21:44, cscooper >>wrote: >> >> We have a matrix job that runs fine except that when the master does >>that >> initial CVS update on the master prior to launching any of the matrix >>builds >> on slaves, it gives a CVS "file was lost" error for every file in the >> project. >> >> The job is parameterized with a boolean named DELETE_WORKSPACE which is >>set >> as the "Check parameter" for "Delete workspace before build starts" in >>the >> Build Environment. If I set DELETE_WORKSPACE to true, the build runs >> perfectly without any CVS errors which implies that my CVS >>authentication is >> correct. >> >> I tried running the CVS commands from the terminal window, and here's >>what I >> see. >> >> If I run the commands directly: >> 1) cvs checkout -P -d project project (this is what Jenkins does if >> DELETE_WORKSPACE is true) >> 2) cvs update -C -d -P project (this is what Jenkins does if >> DELETE_WORKSPACE is false) >> Both CVS commands run fine. >> >> If I let Jenkins run the first command by performing the build: >> 1) Run the Jenkins job with DELETE_WORKSPACE=true >> 2) cvs update -C -d -P project >> During the cvs update, CVS gives me a bunch of warnings about locally >> modified files being moved to temporary files. >> >> And wait, it gets stranger. If I do this: >> 1) Run the Jenkins job with DELETE_WORKSPACE=true >> 2) cvs status project >> 3) cvs update -C -d -P project >> Then I _don't_ get any warnings during the cvs update about locally >>modified >> files. >> >> So it looks like Jenkins is somehow leaving CVS in a strange state >>where it >> thinks my local files have been modified when they really haven't? >> >> Thanks, >> Chris >> >> >> >> >> >> -- >> View this message in context: >>http://jenkins-ci.361315.n4.nabble.com/CVS-error-file-was-lost-in-matrix- >>build-tp4678897.html >> Sent from the Jenkins users mailing list archive at Nabble.com. >> >> -- >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Groovy objects?
We're getting closer (grin)! Let me ask a specific question: In my Jenkins system script, Thread.currentThread() returns an object of type hudson.model.Executor. I know this because in my Groovy script I assigned Thread.currentThread() to an untyped variable (a "def") and then did a println thr.getClass().getName(). Is there any way to get this information from any online documentation? Or is the 'println' method the only way? Thanks, Chris On 10/9/13 10:00 AM, "Eric Pyle" wrote: >This is the doc for the extended JDK used by Groovy: > >http://groovy.codehaus.org/groovy-jdk/ > >I use this regularly when writing Groovy scripts, which I am still >getting the hang of. > >Eric > >On 10/9/2013 11:03 AM, Chris Cooper wrote: >> Thanks! >> >> But I can ask for Thread.currentThread().executable and 'executable' is >> not a member of the Java Thread class, which means >>Thread.currentThread() >> is returning some sub-class of Thread (which is hardly surprising). >> >> Again though, I'm not looking for an answer to "what type of object is >> Thread.currentThread()", what I'm looking for is "Where is the online >> documentation that tells me what type of object Thread.currentThread() >>is" >> so I don't have to post a new query every time I have a new question Š >> >> Chris >> >> On 10/8/13 10:28 PM, "Samuli Saarinen" >>wrote: >> >>> Hi, >>> >>> AFAIK you have access to the whole JVM and you can do pretty much >>> anything. As for your examples just give it a try. java.lang.* is >>> automatically imported so you could eg. run the following script: >>> println("getenv: " + System.getenv()) >>> println("current thread: " + Thread.currentThread()) >>> >>> For further Groovy reference see http://groovy.codehaus.org/Home >>> >>> BR, >>> Samuli >>> >>> >>> -Original Message- >>> From: jenkinsci-users@googlegroups.com >>> [mailto:jenkinsci-users@googlegroups.com] On Behalf Of cscooper >>> Sent: 9. lokakuuta 2013 1:36 >>> To: jenkinsci-users@googlegroups.com >>> Subject: Groovy objects? >>> >>> I'm new to Groovy scripting in Jenkins and I'm not clear on what >>>objects >>> are available. >>> >>> For example, in my System Groovy Script I'm allowed to refer to >>> System.getenv() and Thread.currentThread() but what classes are the >>> System and Thread objects? Where can I find documentation so I know >>>what >>> cool things I can do? >>> >>> Thanks, >>> Chris >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://jenkins-ci.361315.n4.nabble.com/Groovy-objects-tp4678652.html >>> Sent from the Jenkins users mailing list archive at Nabble.com. >>> >>> -- >>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >>> 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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Groovy objects?
Thanks! But I can ask for Thread.currentThread().executable and 'executable' is not a member of the Java Thread class, which means Thread.currentThread() is returning some sub-class of Thread (which is hardly surprising). Again though, I'm not looking for an answer to "what type of object is Thread.currentThread()", what I'm looking for is "Where is the online documentation that tells me what type of object Thread.currentThread() is" so I don't have to post a new query every time I have a new question Š Chris On 10/8/13 10:28 PM, "Samuli Saarinen" wrote: >Hi, > >AFAIK you have access to the whole JVM and you can do pretty much >anything. As for your examples just give it a try. java.lang.* is >automatically imported so you could eg. run the following script: >println("getenv: " + System.getenv()) >println("current thread: " + Thread.currentThread()) > >For further Groovy reference see http://groovy.codehaus.org/Home > >BR, >Samuli > > >-Original Message- >From: jenkinsci-users@googlegroups.com >[mailto:jenkinsci-users@googlegroups.com] On Behalf Of cscooper >Sent: 9. lokakuuta 2013 1:36 >To: jenkinsci-users@googlegroups.com >Subject: Groovy objects? > >I'm new to Groovy scripting in Jenkins and I'm not clear on what objects >are available. > >For example, in my System Groovy Script I'm allowed to refer to >System.getenv() and Thread.currentThread() but what classes are the >System and Thread objects? Where can I find documentation so I know what >cool things I can do? > >Thanks, >Chris > > > > >-- >View this message in context: >http://jenkins-ci.361315.n4.nabble.com/Groovy-objects-tp4678652.html >Sent from the Jenkins users mailing list archive at Nabble.com. > >-- >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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. >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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.