Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / IoT / Raspberry-Pi

Creating Your Own #nodejs Development Server with a #raspberrypi Running #jenkins

4.00/5 (1 vote)
10 Mar 2014CPOL1 min read 10K  
How to create your own #nodejs development server with a #raspberrypi running #jenkins

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 projects 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 below:

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

TMP_SIZE=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 initialization may take a couple of minutes the first time it is executed.

Conclusion

With this configuration, I got a build machine to keep track of 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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)