我正在尝试在Cloudbees上搭建Jenkins构建。我已经成功安装了NodeJs并从BitBucket存储库中获取了我的源代码。我想在部署之前运行grunt任务来压缩和合并我的JS和CSS文件。但是,即使它已成功安装,我也无法运行grunt程序。以下是我的构建脚本:
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
grunt
我曾尝试使用-g选项安装grunt,但无法成功。这是我的构建过程中与grunt有关的控制台输出:
+ npm install grunt
...
npm http GET https://registry.npmjs.org/grunt
npm http 200 https://registry.npmjs.org/grunt
...
grunt@0.4.0 node_modules/grunt
├── dateformat@1.0.2-1.2.3
├── colors@0.6.0-1
├── hooker@0.2.3
├── eventemitter2@0.4.11
├── which@1.0.5
├── iconv-lite@0.2.7
├── coffee-script@1.3.3
├── lodash@0.9.2
├── nopt@1.0.10 (abbrev@1.0.4)
├── rimraf@2.0.3 (graceful-fs@1.1.14)
├── minimatch@0.2.11 (sigmund@1.0.0, lru-cache@2.2.2)
├── glob@3.1.21 (graceful-fs@1.2.0, inherits@1.0.0)
├── findup-sync@0.1.2 (lodash@1.0.1)
└── js-yaml@1.0.3 (argparse@0.1.12)
+ grunt
/tmp/hudson3382014549646667419.sh: line 8: grunt: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
有关如何让这个工作,有什么想法吗?Cloudbees上是否可能实现?