如何组织与咕嘟咕嘟,Maven和詹金斯全力打造的管道,一路集成测试? [英] How to organize full build pipeline with Gulp, Maven and Jenkins, all the way to integration tests?

查看:158
本文介绍了如何组织与咕嘟咕嘟,Maven和詹金斯全力打造的管道,一路集成测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有了一个项目:


  • JS​​客户端有些有趣的构建过程。这包括编译CSS,catenating和缩小文件JS和CSS,发生和处理HTML,以及一些其他步骤。节点工具,如咕噜声或咕嘟咕嘟这是巨大的。

  • 这是部署在Tomcat的一个WAR Java服务器。它包括这些资产以及所有的Java code。它有各种各样的测试:单元测试,这可能实例化一个DAO和交谈DB集成测试和终端到终端的测试API,实际上跟Tomcat上运行应用程序

  • 终端到终端的测试用量角器。如果你不熟悉,它的另一个节点工具包硒。

我怎么能在一个健全的,强大的和自动化的方式来组织这整个过程?

How can I organize this whole process in a sane, robust, and automated way?

我目前所面对的是咕嘟咕嘟和Maven,使用Maven基本上拥有的全过程。

What I have at the moment is Gulp and Maven, with Maven basically owning the whole process.


  1. 它使用antrun呼吁咕嘟咕嘟资产一代产生来源(DOH,第三个构建工具!)。

  2. 它运行常规的Java版本。

  3. 这与我的pre-集成测试WAR启动Tomcat的。

  4. 它运行的Java测试端到端交谈配有安全插件,Tomcat的。

  5. 它调用咕嘟咕嘟再次antrun,这次运行量角器测试。

  6. 它将关闭在Tomcat后的整合测试。

  7. 这应该核实验证测试结果。

这样的作品,除了那些在Maven通常是非常严格的,我觉得我把它太远。使用antrun调用咕嘟咕嘟是一个丑陋伎俩。这是非常难以控制这些步骤之间的依赖关系,并监视他们的成果。很难控制在相同的相位的东西顺序。故障安全验证似乎不处理该咕嘟咕嘟生成JUnit的外部报告文件。我可以继续下去。

That kind of works, except for that Maven is generally very rigid and I feel I'm taking it too far. Using antrun to call Gulp is an ugly trick. It's very hard to control dependencies between these steps and monitor their outcomes. It's hard to control order of things in the same phase. Failsafe verify does not seem to process the external JUnit report files that Gulp generates. I could go on.

我不知道是否我应该在构建服务器(詹金斯)做多,也许用一个构建管道或参数触发 - 但我从来没有做过它,我不知道如果这真的好

I wonder if I should do more in my build server (Jenkins), maybe using a build pipeline or parameterized triggers - but I've never done it and I'm not sure if that's really better.

那么,你将如何实现呢?

So, how would you implement it?

推荐答案

在我的经验中,前端Maven插件是远不是这种类型的构建的最好的插件/部署的过程。 <一href=\"https://github.com/eirslett/frontend-maven-plugin\">https://github.com/eirslett/frontend-maven-plugin 。这是我如何使用它的咕噜声,但它支持咕嘟咕嘟一样好。

In my experience, the frontend maven plugin is far and away the best plugin for this type of build/deploy process. https://github.com/eirslett/frontend-maven-plugin . This is how i use it for Grunt but it supports Gulp just as well.

<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>

有一点需要注意的是将下载节点它正在运行的系统,所以如果你有你的构建服务器上的不同的操作系统,你需要确保的是你已经检查到的版本版本控制,你的本地版本(对我OSX)将必须保持本地到您的项目。

One thing to be aware of it is will download node for the system it is being run on, so if you have a different OS on your build server, you'll need to make sure that is the version you have checked into version control, your local version (for me OSX) will have to be maintained local to your project.

这篇关于如何组织与咕嘟咕嘟,Maven和詹金斯全力打造的管道,一路集成测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆