How do I get a grunt task working with a Cloudbees Jenkins build

自闭症网瘾萝莉.ら 提交于 2019-12-03 15:53:18

Grunt is now broken up, annoyingly, into a separate cli module. Also, annoyingly, that cli module does not include grunt itself.

To make this work:

curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node
NODE_VERSION=0.8.0 \
 source ./use-node
npm install
npm install grunt
npm install grunt-cli
export PATH=$PATH:node_modules/grunt-cli/bin/
grunt

If the folk making this change how it works to be sensible, then it may change in future.

Docs here: http://gruntjs.com/getting-started

you can setup everything from a jenkins job, no ssh/command line required:

Install Jenkins Plugins

  • Git Plugin - for git
  • Git Client Plugin - for git
  • Git Parameter Plugin - for git tags
  • GitHub API Plugin - for github
  • NodeJS Plugin - integration for common javascript tools NodeJS & npm

Git / Ant / Maven / NodeJS Installations

  • Goto SERVER/jenkins/configure
Git
  • Git -> Git installations -> Add Git -> JGit
  • Git plugin -> Global Config user.name Value = "Anthony Mckale", Global Config user.email Value = "anthony.mckale@bskyb.com"
NodeJS
  • NodeJS- > NodeJS installations -> Add NodeJS -> Name = "NodeJS 0.11.10", tick "Install automatically", select "Install from nodejs.org", add "grunt-cli" to globally installed packages

TADA

and hopefully git/nodejs and grunt will be available to you

see the plugin wiki for more details how to add the grunt/node tasks to the jenkins job -> https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

it's really easy :)

no ssh loggin required just jenkins admin rights

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!