Skip to content

Jenkins Configurations

JinlianWang edited this page Nov 24, 2014 · 5 revisions

#####Jenkins workspace folder

Jenkins workspace folder is a very important folder to look at to debug the jenkins build. It contains the source code checkouts, build folder and build artifacts. The build script root is the folder.

/Users/[user login]/builds/jobs/[job name]/workspace

#####"Discard Old Builds" plugin A great plugin to clean up the old builds. You can configure it to keep the build logs/reports for ever or a big number, but keep the artifacts only for the last 5 days (or any smaller number). Another way to clean up the repository is to use Git Plugin, with additional behavior of "Wipe out repository & force clone".

#####"Parameterized builds" You can add parameter to a jenkins job. Once a parameter is added to the job, when the job is started, you need to provide a value for the parameter and continue the build. It is a good way to allow customized builds without creating multiple jobs. For example, you can check "This build is parameterized" option, and then add a "choice" parameter of name "BuildConfiguration", and give it a list of values such as "Debug", "Release" and "Distribution". Once a job is started, you will be presented the choice and continue. The parameter is available to other parts of the job as "${BuildConfiguration}".

To pass it to a gradle build script, you will set -PBuildConfiguration=${BuildConfiguration} as the switch and access the value in gradle xcode plugin as configuration=BuildConfiguration.

#####"Build triggers" You can use this setting to configure when a new build is made, either periodically (using value like "H 23 * * *, to build every night at 23:00) or "Build when a change is pushed to GitHub".

#####"Build Name Setter" plugin You can use this plugin to set a more meaningful build name, like "1.9.${BUILD_NUMBER}", instead of by default "${BUILD_NUMBER}".

#####Environment Variables

${BUILD_NUMBER} and ${SVN_REVISION} are available as part of Jenkins environment variable. They can be used as part of your build name or build artifacts name.

#####Mask Passwords Plugin

Very useful to hide your passwords instead of exposing it on the console or shell scripts.

#####Environment Variables Inject Plugin

Very useful to inject a bunch of environment variables into the jenkins to be able throughout the job configuration.

#####SCP Plugin

Allows to upload build artifacts to repository sites using SCP (SSH) protocol.

#####Navigator Plugin

Allows to retry after build failures.

#####Parameterized Trigger Plugin

Allows to trigger other projects after the successful completion of the job.

Clone this wiki locally