How to trigger a child pipeline or a stage if there is change in any file/files in the specified directory and its subdirectories ?
In my case the dashboard/bb-api/ has many subdirectories and the pipeline only trigges if there is a change in dashboard/bb-api/ and not if there are changes under dashboard/bb-api/src or its subdirectories.
My ci files are as follows
.gitlab-ci.yml
image: prince11jose/mwapi:runner
cache:
paths:
- /root/.m2/repository/
stages:
- triggers
#########################demo######################
Demo B
build_demo_b-api:
stage: triggers
trigger:
include: demo_ci/b-api.yml
rules:
- changes:
- dashboard/bb-api/*
Demo C
build_demo_c-api:
stage: triggers
trigger:
include: demo_ci/c-api.yml
rules:
- changes:
- dashboard/c-api/*
demo_ci/b-api.yml
image: prince11jose/mwapi:runner
cache:
paths:
- /root/.m2/repository/
stages:
- deepcode
- build
#########################demo######################
Demo B
analyze_demo_b-api:
stage: deepcode
script:
- deepcode analyze -p dashboard/b-api/ -txt -sev critical | tee dashboard/b-api/deepcode.txt
artifacts:
paths:
- dashboard/b-api/deepcode.txt
build_demo_b-api:
stage: build
script:
- echo “Building Common”
- ‘mvn -f dashboard -DskipTests=true clean compile install’
- echo “Building b-api”
- ‘mvn -f dashboard/b-api/ -Paws-demo -DskipTests clean compile install’
- cp dashboard/b-api/target/b.war ~/war/demo/b.war
only:
- aws-demo
Should all the subdirectories be specified ?