Creating your own #nodejs development server with a #raspberrypi running #jenkins

Oscar Brito




At home I almost only develop nodejs code and because of that I've been using grunt to run jshint, mocha, ... on my modules.

Because I'm always creating new project and experiments I've a dedicated raspberry pi model b for development purposes.  Until now that raspberry had support to:

This infrastructure is nice but I needed a CI server to test every push request. My previous experience installing Jenkins on a raspberry was not very positive but I decided to give it another try.

Some of the most important installation steps are described bellow:

I installed jenkins using:


sudo apt-get install jenkins jenkins-common


Then I updated the jenkins.war to the latest stable version.


/usr/share/jenkins/jenkins.war


To run jenkins you need to increase the system tmpfs values:


> sudo vim /etc/default/tmpfs

TMPSIZE=1073741824 #1gb
RUN
SIZE=157286400 #150mb


Then configure Jenkins to use oracle arm java version:



> sudo vim /etc/default/jenkins

JENKINS_HOME=/home/jenkins
JAVA=/usr/lib/jvm/jdk-7-oracle-armhf/jre/bin/java


I've also enabled swap and configured a jenkins user on the machine.


Gotcha

Jenkins initialisation may take a couple of minutes on the first time is executed.


Conclusion

With this configuration I got a build machine to keep tracking my changes to the code. Jenkins is not very fast but it's usable.

Some figures of the machine resources with jenkins running follows:


> free -mh

total used free shared buffers cached
Mem: 485M 372M 112M 0B 20M 190M
-/+ buffers/cache: 161M 323M
Swap: 1.0G 0B 1.0G


> df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 150M 69M 82M 46% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 302M 0 302M 0% /run/shm

I hope this has given you some idea on how to build a low voltage server for your home development.

@aetheon





Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.