1

Here is what I wish to do in GitLab CI/CD: Whenever something is pushed into a specific branch I wish to have multiple scrips and CI/CD should decide which script should be run based on the pushed files list.

For example:

  • IF anything changed in ./resources/assets/views/* then run SCRIPT1
  • IF anything changed in ./database/* then run SCRIPT2
  • etc...

Do you Lads have any idea for it?

Bert
  • 1,028
  • 1
  • 16
  • 33

1 Answers1

1

You can achieve this using rules:changes keyword:

job1:
  script:
    - ./script1.sh
  rules:
    - changes:
      - resources/assets/views/**/*

job2:
  script:
    - ./script2.sh
  rules:
    - changes:
      - database/**/*
jbleonesio
  • 126
  • 2
  • Holy sh*t dude. This question is not relevant anymore because it was already done. :D But thanks for the answer, I've marked it, so others can see it. – Bert Aug 29 '23 at 13:17