Javascript 将 Jenkins 用于基于 Gulp 的项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29206061/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using Jenkins for Gulp based project
提问by Amit Mourya
I have a project which uses gulp as a local builder. I want to use Jenkins for versioning my project. How can i setup jenkins for gulp based projects?
我有一个使用 gulp 作为本地构建器的项目。我想使用 Jenkins 对我的项目进行版本控制。如何为基于 gulp 的项目设置 jenkins?
回答by w3bMaster
You will find here a guide on how to setup your Jenkins machine to handle javascscript builds, specifically: how to get to the point of installing your npm packages and running a task runner (gulp/grunt). http://g00glen00b.be/continuous-integration-javascript/
您将在此处找到有关如何设置 Jenkins 机器以处理 javascscript 构建的指南,特别是:如何安装 npm 包并运行任务运行程序 (gulp/grunt)。 http://g00glen00b.be/continuous-integration-javascript/
It details how to install bower and grunt, but changing one of the commands to install gulp instead of grunt-cli should be all that you need to change:
它详细说明了如何安装 bower 和 grunt,但是更改命令之一来安装 gulp 而不是 grunt-cli 应该是您需要更改的全部内容:
instead of :
代替 :
npm install -g bower grunt-cli
you would run:
你会运行:
npm install -g gulp
Also, feel free to skip the parts about SonarQube.
另外,请随意跳过有关 SonarQube 的部分。
回答by skyboyer
it's strange to see it unanswered.
firstly you should install node and to add its path to PATH variable
after that you are free to use something like
node node_modules\gulp\bin\gulp.js yourtasknameas your build step
看到它没有得到答复很奇怪。首先,您应该安装 node 并将其路径添加到 PATH 变量,然后您可以自由地使用类似的东西
node node_modules\gulp\bin\gulp.js yourtaskname作为构建步骤
回答by Adeola Ojo
Simply specify the path to the your gulp file followed by the task name e.g.
只需指定 gulp 文件的路径,后跟任务名称,例如
path_to_gulp_file taskname
path_to_gulp_file 任务名

