Jenkins Build Artist Status Setting

We have a large RAILS project, and we follow the Github stream to manage the development process. I looked through all the available plugins, but could not find anything that configures the "Build Artist Status" part on the jenkins first page. I would like to indicate the name of the git branch instead of the job name and artist number, since the first makes sense in our case. Has anyone done this?

+4
source share
1 answer

You can use the Pluget Set Name Setter to change the name based on the available tokens. I'm not sure if TOKEN exists for your Git branch name, but if all else fails, you can use the script shell build step and write it to the properties file and then use the macro: $ {PROPFILE, ..}, for example:

#${BUILD_NUMBER}_${PROPFILE,file="parameters.properties",property="BUILD_TYPE"} 

Alternatively, you can use the Setter Plugin Description to change the assembly description (which also appears in the Build Executor status) based on the assembly output. Again, you can use the same trick and use a shell script to print the branch name in the output of the assembly and use a regular expression to parse it from the assembly log.

A small limitation: either this update will only update the name / description after the task is completed, so for long tasks it will not be immediately visible. But for short and for audit purposes, this works well.

[EDIT] After some time, I started using the EnvInject plugin, which adds my build options to the environment early enough for the "Font Name Settings Plugin" to use them.

This has the advantage of immediately setting the assembly name.

Alternatively, you can get the Git branch with $ {GIT_BRANCH}. Here is a document for him:

 ${GIT_BRANCH} Expands to the name of the branch that was built. Parameters: all If specified, all the branches that point to the given commit is listed. By default, the token expands to just one of them. fullName If specified, this token expands to the full branch name, such as 'origin/master'. Otherwise, it only expands to the short name, such as 'master'. 
+1
source

All Articles