gitlabgitlab-cicicdopenfaas

Can we detect and get specific directory changed in gitlab CI/CD?


I am a beginner to learn gitlab CI/CD and doing some projects related to it. I have a trouble when using OpenFaaS and build a large number of function.I want to use CI/CD to automatically build functions that have updates, remain functions are not, but I don't know how to get name of specific folder or directory changed in my source to build corresponding functions.

So I wonder if we have a way to get name of specific directory changed in Gitlab CI/CD? Or another tools CI/CD can do that?


Solution

  • only:changes is what you are looking for:

    #.gitlab-ci.yml
    my job:
      script: echo "I am triggered only when changes to some/dir are applied"
      only:
        changes:
          - some/dir/**/*