I’ve been working on
laika for last 2 months with support from the community, and we have fixed lots of bugs and added some crucial features. Still laika is not perfect, but it is moving towards that. I’ve seen few people asking on how do Continous Integration(CI) with Meteor. So here is how you can do CI for your meteor apps with
For this article, I’ll show you how to enable laika based CI for meteor with two popular continuous integration services.(travis-ci and codeship) If you are using some other service or a self hosted solution, look at the end of the article.
Travis-CI is well known for their free Continuous Integration service for OpenSource projects. And they’ve recently launched their paid service for private repositories with https://travis-ci.com. Let’s have a look at how to configure travis-ci for laika.
.travis.ymlfile in your project root as shown below
Add following content to
language: node_js node_js: - "0.10" before_install: - "curl -L http://git.io/3l-rRA | /bin/sh" services: - mongodb env: - LAIKA_OPTIONS="-t 5000"
I’ve added travis-support for hello-laika project as an example.
CodeShip is another popular Continuous Integration service for private projects. It has more features over travis-ci. Also it is so valuable and cheap if you only have one or two projects to manage. Here is how you can add laika support on codeship.
Replace setup commands with following
git clone https://github.com/meteor/meteor.git ~/meteor export PATH=~/meteor/:$PATH npm install -g meteorite laika
Replace test commands with following
METEOR_PATH=~/meteor laika -t 5000
I’ve added codeship support for hello-laika as well.
There are lots of other Continuous Integration services and downloaded servers out there. It is not feasible to provide how-to guides for all. Let’s discuss in general how we can add laika support for them.
All of these tools and services provide a way to customize their runtime and the test. Most of the time we can configure them using shell scripts. We can categorize them into two.
Laika can be configure for both very easily. Let’s look at how.
- Assume you’ve configured or installed
- Assume there is a local mongodb server is running
- Assume phantomjs is installed and available on the path
#install meteor normally curl https://install.meteor.com | /bin/sh #installing meteorite and laika npm install -g meteorite laika #run tests laika #<options>
#install meteor from git git clone https://github.com/meteor/meteor.git ~/meteor export PATH=~/meteor/:$PATH #install meteorite and laika npm install -g meteorite laika #run tests METEOR_PATH=~/meteor laika -t 5000
I hope with this information, you could setup your meteor app for Continuous Integration very easily. Let me know how you think about this, share your experiences.