How to use parallel: matrix in gitlab.ci to run multiple maven profiles - Stack Overflow

Curious if I can do something like what is below, essentially use parallel matrix to tack -P flags to t

Curious if I can do something like what is below, essentially use parallel matrix to tack -P flags to the maven script. Is there a way to use parallel matrix to add different maven profiles and run the scripts in parallel? Or is there another way to do this without having the jobs separated? I want them coupled together in the pipeline.

test-e2e:
  stage: test
  script:
    - |
      mvn $MAVEN_CLI_OPTS test
  parallel:
    matrix:
      - VERSION: [-Ptest1,-Ptest2]

Curious if I can do something like what is below, essentially use parallel matrix to tack -P flags to the maven script. Is there a way to use parallel matrix to add different maven profiles and run the scripts in parallel? Or is there another way to do this without having the jobs separated? I want them coupled together in the pipeline.

test-e2e:
  stage: test
  script:
    - |
      mvn $MAVEN_CLI_OPTS test
  parallel:
    matrix:
      - VERSION: [-Ptest1,-Ptest2]
Share Improve this question asked Nov 19, 2024 at 20:49 himan01himan01 132 bronze badges 1
  • 1 Why do you need those profiles? What is the purpose of them? Can you show your pom file? Which Maven version, JDK versio etc. do you use? – khmarbaise Commented Nov 20, 2024 at 7:23
Add a comment  | 

1 Answer 1

Reset to default 0

You can use the value specified in matrix as a regular environment variable:

test-e2e:
  stage: test
  script:
    - |
      mvn $MAVEN_CLI_OPTS test ${VERSION}
  parallel:
    matrix:
      - VERSION: [-Ptest1,-Ptest2]

Note that this is just a syntactic sugar to reduce code duplication, so there is no special coupling between jobs.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742399501a4436622.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信