我有一个项目:
我怎样才能以健全、稳健和自动化的方式组织整个过程?
我目前拥有的是 Gulp 和 Maven,Maven 基本上拥有整个流程。
这种工作,除了 Maven 通常非常严格,我觉得我太过分了。使用 antrun 调用 Gulp 是一个丑陋的把戏。很难控制这些步骤之间的依赖关系并监控它们的结果。在同一阶段很难控制事物的顺序。 Failsafe verify 似乎没有处理 Gulp 生成的外部 JUnit 报告文件。我可以继续。
我想知道我是否应该在我的构建服务器 (Jenkins) 中做更多事情,也许使用构建管道或参数化触发器 - 但我从未这样做过,我不确定这是否真的更好。
那么,你将如何实现它?
最佳答案
根据我的经验,前端 maven 插件无疑是此类构建/部署过程的最佳插件。 https://github.com/eirslett/frontend-maven-plugin .这就是我将它用于 Grunt 的方式,但它也支持 Gulp。
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>...</version>
<!-- optional -->
<configuration>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: if not specified, it will run Grunt's default
task (and you can remove this whole <configuration> section.) -->
<arguments>build</arguments>
</configuration>
</execution>
</plugin>
需要注意的一点是,将为正在运行它的系统下载节点,因此,如果您的构建服务器上有不同的操作系统,则需要确保该版本是您已 checkin 的版本版本控制,你的本地版本(对我来说是 OSX)必须在你的项目本地维护。
关于maven - 如何使用 Gulp、Maven 和 Jenkins 组织完整的构建管道,一直到集成测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25865251/