Firstly, download a Vagrant Box at http://files.vagrantup.com/precise32.box (or precise64.box)
Then add a box by running the command below
vagrant box add jenkins http://files.vagrantup.com/precise32.box
or if you have already downloaded the box to your local machine, run
vagrant box add jenkins precise32.box
Finally, run vagrant up
to start the virtual machine.
Note: All of these steps will be done during vagrant up
.
Run the following commands:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
For more inforamtion, read https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu.
- Install Git Plugin to integrate with Git SCM.
- Install GitHub Plugin to integrate with GitHub.
- Install Build Pipeline Plugin.
- Install Green Balls to use green balls instead of blue for successful builds.
- Create a free-style project.
- Use Git as SCM and point to https (since it doesn’t require a ssh key.)
- Use Poll SCM (
* * * * *
for polling every minute). - Use the same workspace (custom workspace
/var/www/fizzbuzz
) - Create a unit test project.
- Set the build trigger to "build after other projects are built."
- Use the same workspace (custom workspace
/var/www/fizzbuzz
). - Create another project to do whatever you want and add it to the pipeline.
- Generate a report in the unit test project.
- Run
vagrant ssh
to SSH to the Jenkins server. - Run
sudo apt-get install python-setuptools
. - Run
sudo easy_install pip
. - Run
sudo pip install xmlrunner
. - Configure the "another unit test" project to read the report.
- Add a post-build action - Publish jUnit test result report.