Thursday, October 3, 2013

GRUNT lets you call a function and write to the console, and here is how.

Keeping with this, and with the last line still reading...

grunt.registerTask('foo', ['bar', 'baz', 'qux']);

 

 

The following could be replaced...

grunt.registerTask('bar', 'sweet');

 

 

...with...

grunt.registerTask('bar', function() {
   console.log("Tom Jaeschke is getting better at Grunt!");
});

 

 

...to both call a function and then, ultimately, write a line to "the console" which could be, in the case of Jenkins, what one sees at the "Console Output" link's page at the build results of a Jenkins' build.

Wednesday, October 2, 2013

Drama with calling GIT from package.json in Node.js installs.

Remember how I told you you could use git urls for specifying dependencies in a package.json? Well, if you run an install from Jenkins in a Mac environment you will be fine, but not so in Windowsland. This suggests: This is a bug in graceful-fs. It's catching EMFILEs from fs.open, but not from fs.readdir, which also uses a file descriptor. Patch coming soon. The error materializes in showing off a lot of ENOENT alerts which sort of mean "no such file or directory" as a rule.

java.io.IOException: Cannot run program "cmd"

This error is telling you that the "Execute shell" and "Execute Windows batch command" build steps in Jenkins are not the same thing. You cannot run a "Execute Windows batch command" step at a Macintosh.

"Wipe Out Workspace" link in Jenkins.

The node.js error of... Error: Cannot find module 'graceful-fs' ...of which this suggests... "The same also happens on Windows if you install in a custom directory. You have to uninstall and install again under default path." ...may be bested in Jenkins-deploys-to-Windows with ease. At these links at the upper left in Jenkins:

  • Back to Dashboard
  • Status
  • Changes
  • Workspace
  • Build Now
  • Delete Project
  • Configure
  • Set Next Build Number

...the "Workspace" link expands to offer a "Wipe Out Workspace" link which should be your salvation. The node error surfaced for me when I renamed a build. To fix, I:

  1. first went back to the old name, where the build worked anew
  2. clicked "Wipe Out Workspace"
  3. renamed the build back to the name I wanted
  4. clicked "Wipe Out Workspace"

I'm not sure if the first two steps above were unneeded or not. This is just how I approached this problem. graceful-fs is no longer blocking me at any rate.

Tuesday, October 1, 2013

Add label expressions in Jenkins to restrain which servers a build may run upon.

Where you spec the specifications for a build in Jenkins there will be a place to add Label Expressions where you may add a series of string values like so:

nodejs && grunt

 
 

At the home page of Jenkins you should see a list of servers at the lower left. If you click on one and then click "Configure" at the server's summary you will get another configuration screen. Herein there will be a fill-in-the-blank field for "Labels" and here too you may add string values. This time you will just separate the strings with spaces however. Match values at a build configuration's "Label Expressions" up to values here to restrain the possible servers a build may be built upon. Jenkins may randomly run a build on any server in the list without you restraining its choices in this way.

Create web hooks in FogBugz Kiln.

  1. Go to the Settings for a repository.
  2. Click on the "Add, remove, or learn more about web hooks" link. (You need to be a site admin to see this link.)
  3. At the bottom of the list of web hooks which appears click upon the "Create New Web Hook" link.
  4. The "Custom Hook" option seems to merely be made of just a name and a url. Well, you may also check checkboxes for including specific repositories.
  5. This is a way to trigger a Fogbugz plugin to kick off a Jenkins build.

%40 represents an at symbol at the url line!

%20 is a space obviously. A cheat sheet is given here. %23 is a pound sign, %24 is a dollar sign, and %25 is a percent sign.