Created
March 2, 2014 16:46
-
-
Save sheehan/9309382 to your computer and use it in GitHub Desktop.
Install grunt on demand in a Jenkins build step. Adapted from https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_version=0.10.26 | |
node_name=node-v${node_version}-linux-x64 | |
node_dir=~/jenkins/node | |
mkdir -p $node_dir | |
test -f ${node_dir}/${node_name}.tar.gz || wget -P $node_dir http://nodejs.org/dist/v${node_version}/${node_name}.tar.gz | |
test -f ${node_dir}/${node_name}/bin/node || tar -zxvf ${node_dir}/${node_name}.tar.gz -C $node_dir | |
export PATH=${node_dir}/${node_name}/bin:$PATH | |
npm install | |
npm install grunt | |
npm install grunt-cli | |
export PATH=$PATH:node_modules/grunt-cli/bin/ | |
grunt test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment