How to execute package for one submodule only on Jenkins?

后端 未结 2 1866
轻奢々
轻奢々 2020-12-31 15:28

I have a sbt project with 4 modules: module-a, module-b, module-c, module-d.

Each module can be packaged as a WA

相关标签:
2条回答
  • 2020-12-31 15:33

    You may also like to execute project-scoped clean and test tasks as follows:

    sbt module-a/clean module-a/test
    

    The solution is slightly shorter and clearer as to what project the following commands apply to.

    You don't need to execute update task since it's implicitly executed by test as described in inspect tree test.

    There's a way to make it cleaner with an alias. Use the following in the build.sbt:

    addCommandAlias("jenkinsJob4ModuleA", "; module-a/clean; module-a/test")
    

    With the alias, execute jenkinsJob4ModuleA to have the same effect as the above solution.

    0 讨论(0)
  • 2020-12-31 15:52

    Quote the argument to project, i.e. project module-a, and don't use a dash before the name of the submodule.

    The entire command line for the Jenkins job would than be as follows:

    ./sbt "project module-a" clean update test
    
    0 讨论(0)
提交回复
热议问题