Add file matching rule to flexible CI rules
Problem to solve
Currently it's not possible to evaluate a project's contents and use
except logic before running a pipeline. This means that Auto DevOps pipelines run even when they won't add any value (for example on projects using a language with no matching buildpack or projects that host no code).
Please rely on the documentation to view the accepted solution
In order to use the same mechanism Auto DevOps uses to detect a project's language (herokuish+buildpacks) and evaluate contents of a project before running a pipeline, a new flexible rule to GitLab CI so that it may look for files or directories in the relevant project. This rule will be similar to
changes. This will allow us to Not run Auto DevOps when no dockerfile or matching buildpack exists
I would like to be able to do something like the following for auto devops:
build_dockerfile: script: - docker build rules: - local: - Dockerfile build_herokuish: script: - docker run herokuish rules: - local: - Dockerfile when: never - if: '$KUBECONFIG'
Or in general we could do other things like:
rake: image: ruby script: - bundle install - bundle exec rake rules: - local: - Rakefile
which could replace the herokuish logic for build/test and in theory will be much more performant because it is able to cache the build images. Furthermore it allows us to customise the steps for each language a lot more easily.
What does success look like, and how can we measure that?