Continuous Integration (CI) is the autotesting of unit tests.
Why autotest?
There are many good answers. First and most importantly, developers get fast notification of when and where defects were committed to the source code repo. Testing on multiple platforms and environments also becomes possible and automatic. Invoking a unit test build manually is silly when we have computers. Let's be smart and lazy.
autoprove (Test::Continous): a lightweight Perl-only CI app. Broken in Perl 5.18.0+.
Smolder: a heavyweight Perl-only CI server. Broken in Perl 5.12+/OSX.
Jenkins. A fork of Hudson. Open source. Free. Mature. Polyglot. Network farm architecture. Plugins for everything.
- Install from http://jenkins-ci.org/ (don't use
brew install jenkins
- it's old) - patch if necessary from jenkinsci/jenkins#828
- cpanm -S Task::Jenkins
- Git Client Plugin
- Git Plugin
- Instant Messaging Plugin
- IRC Plugin
- Growl Plugin
- Redmine Plugin
- Active Directory plugin
- Perl Plugin
- Green Balls
- Dashboard View
Deactivate:
- CVS
- Svn
[√] Environment variables
PERLBREW_HOME: /opt/perlbrew
PERLBREW_ROOT: /opt/perlbrew
Global Config user.name Value: Jenkins CI
Global Config user.email Value: [email protected] # or a role account
Global password: RingRing
Shell executable: /bin/bash
Needed instead of /bin/sh for perlbrew integration.
[√] Enable IRC Notification
Hostname: as7585.integra.net
Port: 6667
SMTP server: relay.integra.net
Default email suffix: @integratelecom.com
Instructions at https://wiki.jenkins-ci.org/display/JENKINS/Gitolite
In short:
- Create ssh-key for user jenkins.
- Copy to gitolite-admin/keydir/ as jenkins_rsa.pub
- Add jenkins_rsa to readonly users in gitolite-admin/conf/gitolite.conf
- git commit -am 'Add jenkins' && git push
Can plug into AD, LDAP, or Redmine for auth.
Configuration TBD.
On main page:
- Click the [+] tab
- Name it ""
- Add everything?
How to add a new git repo to Jenkins.
Click New Job on the left.
Job Name: Widget-Twister
[√] Copy from existing Job (eg CA-API)
Update the CA-API settings:
[√] Git
Repository URL: git@git:repository-name
[√] Poll SCM
Schedule:
# every 5 minutes M-F
H/5 * * * 1-5
Execute Shell | Add build step
source /opt/perlbrew/etc/bashrc
perlbrew use perl-5.16.2@dev
/opt/perlbrew/libs/perl-5.16.2@dev/bin/prove -r --timer --formatter=TAP::Formatter::JUnit -l t
Growl IP: Your desktop IP
Also add passsword "RingRing" to System Preferences | Growl. This will permit other computers to send notifications to your Desktop.
Click Advanced
Channel Name: #ci
Notification Strategy: change
Problem: The Java Permgen pool would run out of memory and the app would stop responding.
Jenkins' heap allocations can be viewed by running sudo jmap -heap $(pgrep -u jenkins java)
Fix: Submitted jenkinsci/jenkins#828. This adds controls for Java heap sizing and working defaults on OSX.