GitLab CI How to run a pipeline for submodules in a maven multimodule project

I have a multi-module Maven project:

root
    SubmoduleA
        src
        pom.xml      
    SubmoduleB
        src
        pom.xml
    pom.xml
    .gitlab-ci.yml

Is it possible to somehow initiate the CI pipeline only on SubmoduleA when someone checks code that only affects SubmoduleA? For example, someone is making changes to SubmoduleA. After they commit and click, I want to automatically run build-> test-> deploy only on SubmoduleA, since there were no changes to SubmoduleB.

Is there a way to specify triggers and tasks for specific submodules or subprojects within the repo?

+8
source share
2 answers

, gitlab , .gitlab-ci.yml. gitlab-ci-runner.

Maven ( Java), , , . , , Maven. Maven , , , , Java , git .

.Net nuget, , , , , - , .

+3

Gitlab : https://docs.gitlab.com/ee/ci/yaml/#onlychanges

:

  • gitlab maven, .
stages:
  - modules
  - build

moduleB:
  stage: modules
  script: 
    - mvn $MAVEN_OPTS -pl projectB clean install --also-make $MAVEN_CLI_OPTS
  only:
    changes:
      - projectB/**

master_job:
  stage: build
  dependencies:
    - projectB
  script:
    - >
      mvn $MAVEN_OPTS -pl projectA clean install $MAVEN_CLI_OPTS
0

Source: https://habr.com/ru/post/1655535/


All Articles