Triggers


Trigger other pipelines

Ability to split automation

Trigger tokens

Trigger pipelines using trigger tokens

Fire and forget

Multi-project pipelines

Links to downstream pipelines

Use the trigger keyword

Parent-child pipelines

Run additional stages and jobs from a file using include


Hands-On: Trigger tokens

  1. Create a new project (anywhere!)
  2. Add trigger/.gitlab-ci.yml
  3. Go to Settings > CI/CD and unfold Pipeline triggers
  4. Create a trigger
  5. Copy curl snippet
  6. Go back to previous project
  7. Add new stage and job called trigger
  8. Add curl snippet in script block
  9. Store TOKEN as unprotected but masked CI variable
  10. Fill in REF_NAME with branch name (probably main)

(See new .gitlab-ci.yml)


Hands-On: Multi-project pipelines

  1. Replace script with trigger keyword
  2. Specify project and branch:

     job_name:
       trigger:
         project: foo/bar
         branch: baz
    
  3. Check pipeline

Hands-On: Parent-child pipelines

  1. Add parent/child/child.yml to first project
  2. Replace project and branch in trigger with include

     job_name:
       trigger:
         include: child.yml
    

Child pipeline can be made from multiple files

include supports local for files in the same repository

project/ref/file for files in other repositories