Handling multiple branches in continuous integration

When you talk about scaling CI you’re really talking about scaling the use of your CI server to handle all your feature branches along with your mainline. Initially this looks like a good approach as the developers in a branch get all the advantages of the automated testing that the CI jobs include. However, you … Read more

In Jenkins, how to checkout a project into a specific directory (using GIT)

In the new Jenkins 2.0 pipeline (previously named the Workflow Plugin), this is done differently for: The main repository Other additional repositories Here I am specifically referring to the Multibranch Pipeline version 2.9. Main repository This is the repository that contains your Jenkinsfile. In the Configure screen for your pipeline project, enter your repository name, … Read more

How do I clear my Jenkins/Hudson build history?

Use the script console (Manage Jenkins > Script Console) and something like this script to bulk delete a job’s build history https://github.com/jenkinsci/jenkins-scripts/blob/master/scriptler/bulkDeleteBuilds.groovy That script assumes you want to only delete a range of builds. To delete all builds for a given job, use this (tested): // change this variable to match the name of the … Read more

Increase the Jenkins login timeout

Jenkins uses Jetty, and Jetty’s default timeout is 30 minutes. This is independent of authentication settings — I use Active Directory but it’s still this setting that affects timeouts. You can override the timeout by passing an argument –sessionTimeout=<minutes> to the Jenkins init script, or -DsessionTimeout=<minutes> to the .war file. For example: # Set the … Read more

How to trigger a build only if changes happen on particular set of files

The Git plugin has an option (excluded region) to use regexes to determine whether to skip building based on whether files in the commit match the excluded region regex. Unfortunately, the stock Git plugin does not have a “included region” feature at this time (1.15). However, someone posted patches on GitHub that work on Jenkins … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)