Article From:

Jenkins is often used in continuous integration. There are many plug-ins on the Jenkins. Using these plug-ins can help us improve efficiency.

1. groovy postbuild Get construction related data

groovyIt’s a programming language. We can write groovy scripts to get some data in construction, such as building numbers, branch, etc. In the “increase structure operation steps”, select the goovy postbuild tool. You can use the following code to get people to build, build branches, etc.Interest.

def user =
def matcher = manager.getLogMatcher(".*-(.*-.*).ipa")
if(matcher?.matches()) {

def  branch ="BRANCH")
def  slave =
desc = "Br: ${branch} Sl: ${slave}"
desc = "Br: ${branch}"

  In the script, get the build information from the build log and get the branch information from the parameter. When executing, you may encounter problems without permission, such as

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method hudson.model.Run setDescription java.lang.String
at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(
In this case, you need 1. not to select Use Groovy Sandbox 2. and then find Jenkins's adminstor to navigate to jenkins> manage jenkins> the script approval within the process agrees that this script will notThis is the problem.


Link of this Article: Jenkins continuous integration

Leave a Reply

Your email address will not be published. Required fields are marked *