This project provides provisioning files for setting up a jenkins server for doing ruby on rails continuous integration and deployment, with Vagrant support. Still under active development.
git clone [email protected]:robotadmin/jenkins_rails_ci.git
cd jenkins_rails_ci
source bootstrap.sh
If you run the machine as is in the free tier, you can get an error "java.io.IOException: error=12, Cannot allocate memory". This is due jenkins not being able to allocate memory as a result of the JVM forking process (see this stackoverflow question for an excellent explanation). There are two main steps that you should follow in order to prevent this from happening:
-
First, configure a swap file (or swap partition). I added a helper script for that which is here.
-
Second, edit /etc/default/jenkins, and add the following line to adjust the size of the JVM heap size:
JAVA_ARGS="-Xmx128m -Xms128m"
You can experiment with the arguments a bit (see more info here) -- 128m was really the maximum size of the JVM that I could allow in the Amazon AWS free tier.
- copy the contents of the repo into your vagrant shared directory (which will be "shared" in /vagrant inside the virtual machine)
- add the following line to your Vagrantfile: config.vm.provision :shell, :path => "bootstrap.sh"
- boot the VM normally with "vagrant init".
For more information about provisioning Vagrant, check out this link
I used bootstrap.sh normally to provision a Amazon AWS machine. However, this project looks promising, it allows you to control and provision an AWS machine based on Vagrant.
- There are helper scripts for
-
http://jenkins-ci.361315.n4.nabble.com/Installing-Jenkins-plugins-via-API-td4639021.html
-
https://wiki.jenkins-ci.org/display/JENKINS/Configuring+a+Rails+build
-
http://stackoverflow.com/questions/5212304/authenticate-jenkins-ci-for-github-private-repository
- Thanks @jmmendes for help debugging and configuring.