How to organize full build pipeline with Gulp, Maven and Jenkins, all the way to integration tests?

前端 未结 4 537
悲哀的现实
悲哀的现实 2020-12-12 21:23

I have a project that has:

  • JS client with somewhat interesting build process. That includes compiling CSS, catenating and minifying JS and CSS, generating and
4条回答
  •  难免孤独
    2020-12-12 21:40

    I'd try to build kind of poor-man's-pipeline.

    1. Let grunt/gulp do its work first (process assets, run frontend tests etc - prepare artifacts to be included in WAR). Fail entire build when this step fails (assets generation or tests).

    2. Run regular maven build producing WAR file with assets created in step 1. It will run own set of tests with just regular WAR file. Doesn't need to know about grunt/gulp things.

    You'll then have two places where e.g. tests are run (frontend, run by grunt/gulp and backend by maven) but configuring correct reporters will let CI servers to detect all of them (we use TeamCity and it handles it fine).

    Script it up a bit and it should be better than calling node via antrun multiple times. Alternatively you can run first step from within maven build, but it may be hard to control stuff.

提交回复
热议问题