09Jul

Working Notes: Jenkins, Git, Grunt, Mocha, Zombie, Coffee, Require

Posted by Elf Sternberg as javascript, programming

I really don’t get grunt. What does it do that Makefile doesn’t? As far as I can tell, it does it’s thing in Javascript, which means that programmers don’t have to learn Make’s baroque syntax to get things done, but that also means that it has its own problems with respect to sources, targets, and rebuilding only what is necessary.

Still, everyone seems to be using it, so I knuckled down today and taught myself how to use it. I wrote a couple of helpers– one that invokes Ruby’s HAML compiler (which I prefer over the JS versions because it has a command-line flag that won’t mangle Underscore templates, and over Jade because I also write Ruby and have no desire to learn Yet Another Templating Language, the payoff for which is fairly small compared to the benefit), and another that invokes Underscore’s “template” function to generate template scripts and wrap them in Require.JS’s define() function. So now I know how to grunt. Ung.

I also got it to compile with Require.JS, although I haven’t quite gotten the Almond shim to work. Nor have I managed to compile various Less and CSS scripts into one smart compiled CSS file with Recess.

I also installed Jenkins on my dev box in its own account, and built a new job for it to check out my source code. That’s all it does right now, but it’s been a long time since I last used Hudson, and I’m doing it correctly this time. It’s nice to see that the Git plugin works now.

Later, I built a new Mocha script around our old Zombie tests suit, written in Coffeescript. It took me a while to track down a single bug in the Zombie script (Mocha needs the asynchronous callback passed in explicitly), but by the end of the day I had Jenkins checking out the source tree, building it, running grunt’s server on the ./dist file, and failing the “download the home page and assert the title is set correctly” test.

Okay, so I’m not yet printing “Hello World.” It’s only eight hours of effort.

2 Responses to Working Notes: Jenkins, Git, Grunt, Mocha, Zombie, Coffee, Require

Josh

July 23rd, 2013 at 9:14 am

heh.. this came in first when i typed ‘git grunt jenkins’ into goduckgo.. good on ya!… i think you meant to say “the payoff for which is fairly small compared to the effort” in the second paragraph, not “the payoff for which is fairly small compared to the benefit”

so.. how’s it going now? what’s your preferred stack, if I may ask?

Elf Sternberg

August 26th, 2013 at 10:17 am

Well, I landed a full-time job, so I’m stuck with whatever was here when I got here. That’s mostly Makefiles, which I approve, and we’re using Jenkins still, but we have an in-house web testing framework that we’re pretty happy with.

For my side projects, I’m currently really happy with tup, which looks a lot like Makefiles and has a lot of the same semantics, but has been updated to run on all modern OS’s, can be built with inotify capability, and just Generally Works.

Comment Form

Subscribe to Feed

Categories

Calendar

July 2012
M T W T F S S
« Jun   Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
3031