Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

How can I set the build description by script? #1381

jeonghoon-jeon ·
hello, robin.
I want to write some information in build description when end the build by automatically.
so, I setted this script in master step's 'Post-Execute Action'.

--------------------------------------------------------------
groovy:
import com.pmease.quickbuild.Context;

def String information= ~~~~~~
current.getBuild().setDescription(information);
Context.getLogger().warn(current.getBuild().getDescription()); //for test
-------------------------------------------------------------

Build log display the build description, but actually build description was not saved. ( I can't see the build description in build overview!)
How can I set the build description by script?

best regards,
Jeon
  • replies 13
  • views 4877
  • stars 0
robinshen ADMIN ·
Hi Jeon,

Please do this in the pre-build script like below in the advanced setting of the configuration:

build.setDescription("description of the build");


Regards
Robin
jeonghoon-jeon ·
oh, you're so kind~

Thanks for your help robin <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
mbbb ·
Hi,

Is there any way to set description in post build script, or at any step ? because figure it out only in the middle of build process.

Thanks
robinshen ADMIN ·
If on the middle of the build or in post-build script, add the calling to "system.buildManager.save(build)" after changing the description.
mbbb ·
Thanks a lot!
I tried it before and it didn't work.
build.setDescription("some description") 
system.buildManager.save(build)

By accident I added "groovy:" before, and than it works..
robinshen ADMIN ·
Yes forget to mention this has to be a groovy script.
mbbb ·
I am trying it in middle of a step, but its not work.
Can you please help me in that ?
robinshen ADMIN ·
Make sure the step runs at server to make this working.
mbbb ·
Thanks, but still doesn't working. What am I missing ?
robinshen ADMIN ·
Sorry I was wrong. Build description have to be set in post-build script field. Changing it while build is running will have no effect.
Laba42 ·
Hello,
i also want to edit the "Description" during the build. I put following code in the "Post-Execute Action" in the master Step of my configuration.
${groovy: 
import com.pmease.quickbuild.Context;
String description = "Gebaut wurde das Project: "+ vars.getValue("ProjectName") ;
build.setDescription(description);
system.buildManager.save(build);
Context.getLogger().debug(build.getDescription());
}

after the build is finished, there appears only the Debug Info,

15:28:03,909 [master@ComputerName:8810] INFO - Executing post-execute action...
15:28:03,913 [master@ComputerName:8810] DEBUG - Gebaut wurde das Projekte: KarlHeinz

but no Description Pane with the Message!

Georg
robinshen ADMIN ·
Not in post-execute action of master step. Instead look for advanced page of configuration setting and find the "post-build script" there.
Laba42 ·
Thanks, it works!