Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,889
    • Issues 34,889
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,218
    • Merge Requests 1,218
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #24021

Closed
Open
Opened Sep 06, 2018 by Dylan Griffith@DylanGriffith🔴Maintainer

Add file matching rule to flexible CI rules

Problem to solve

Currently it's not possible to evaluate a project's contents and use only or 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).

Intended users

developers

Further details

Proposal

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.

Documentation

Testing

What does success look like, and how can we measure that?

TBD

Links / references

https://gitlab.com/gitlab-org/gitlab-ce/issues/57483

Edited May 12, 2020 by Tim Poffenbarger
Assignee
Assign to
12.4
Milestone
12.4 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#24021