QA/Execution/Web Testing/Automation/Jenkins
Summary
Jenkins CI is used by Web QA to run automated tests. The web dashboard can be accessed here (VPN required).
Installation
Jenkins is installed as a launch daemon, listening on port 8080. (If you want to know more about launchd and daemons, see here and here.)
Configuration
Boot configuration
The following have been configured for when Jenkins boots:
SETTING | VALUE |
---|---|
heapSize | 2g |
permGen | 512M |
- To view all settings in the file, run:
defaults read /Library/Preferences/org.jenkins-ci
- To get the value of a single setting, run:
defaults read /Library/Preferences/org.jenkins-ci SETTING
- To set the value of a setting, run:
defaults write /Library/Preferences/org.jenkins-ci SETTING VALUE
Other configuration
- Location of jenkins.war: /Applications/Jenkins/jenkins.war
- Location of Jenkins home directory: /Users/Shared/Jenkins/Home
Starting/restarting/stopping the service
- To restart via the dashboard visit http://qa-selenium.mv.mozilla.com:8080/restart
- To manually start the daemon:
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
- To manually stop the daemon:
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Plugins
Below is a list of plugins in use (dependencies have been omitted):
- LDAP - User authentication
- IRC - IRC bot for triggering builds and notifications
- Setenv - Set environment variables for jobs
- URL Change Trigger - Trigger builds when a URL changes
- Build Timeout - Abort builds that take too long
- Disk Usage - Calculates disk usage
- github - Integrates github
- Green Balls - Green is better than blue!
- HTML Publisher - Publishes HTML reports
- Jenkins Job Configuration History - Provides history of configuration changes
- ThinBackup - Scheduled backups of system and job configurations
- xUnit - Generates reports based on test results
Upgrading
To be written.
Disaster recovery
Backing up
Jenkins is entirely file based so a true full backup would be simply storing a copy of the entire home directory in another location. That said, the ThinBackup plugin is used to perform scheduled (daily) backups of the Jenkins system and job configurations to http://fs2.office.mozilla.org/public/QA/WebQA/Jenkins/. Note that this backup does not include plugins.
Restoring from backup
If you are simply restoring system or job configuration then you can use the backups created by the ThinBackup plugin.
Migrating to a new server
If you are recovering from a hardware failure or are migrating to a new server then the backups created by the ThinBackup plugin will not be adequate. If you have access to the original server then the best way to restore is to simply copy the entire Jenkins home directory to the new server. Make sure that the instance on the original server is stopped before performing the copy.
If for some reason you do not have access to the original server then a partial backup will have to do. Install the ThinBackup plugin to a clean Jenkins instance and restore from the latest backup. Any plugins that are needed will have to be installed manually.
Console
Log messages can be seen by opening the Console application. A log query named Jenkins CI has been created, which filters by the sender: org.jenkins-ci
.
References
Some content has been taken from here.