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 35,963
    • Issues 35,963
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,295
    • Merge Requests 1,295
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #8997

Closed
Open
Opened Apr 29, 2016 by Mark Pundsack@markpundsackContributor

Cross-project `trigger` ability

Problem

We currently support triggers via the API, but to use it in a .gitlab-ci.yml requires ugly CURLing and passing secure tokens.

Further information

As a developer, I want to be able to trigger CI build for one component after completing another component. e.g. make a change to the API, then trigger a pipeline for a downstream dependency to pick up the changes.

Solution

We simplify that process by providing a higher-level construct and replace/supplement https://docs.gitlab.com/ee/ci/triggers/#ci-job-token (EE feature)

Note: We do not replace/supplement https://docs.gitlab.com/ce/ci/triggers/README.html#trigger-token (CE and EE feature)

job:
  trigger: my/project
  • The variables included in the vars: section are passed automatically to the triggered pipeline.
  • The job which represents the trigger will not be clickable (similar to a deploy job to GitLab pages) and thus will have no job detail page
  • Jobs that are not clickable will have their cursor change to not-allowed (trigger jobs + GitLab pages jobs)
  • A trigger job cannot have a script of its own
  • A trigger job should not represent a downstream project pipeline as we already have dedicated nodes for that inside of the pipeline graph + this would have made things complicated for https://gitlab.com/gitlab-org/gitlab-ce/issues/39640.
  • https://gitlab.com/gitlab-org/gitlab-ce/issues/39640 will essentially be an iteration on trigger jobs and adds wait/depend to the mix so the status waits/depends on the downstream pipeline as well.
  • For this issue the trigger job will just succeed after triggering the downstream pipeline.
  • Trigger jobs will have the tag/badge trigger
    • triggered by api jobs will have its tag changed to triggered by api

Links / references

  • Originally from https://gitlab.com/gitlab-org/gitlab-ee/issues/933 (Multi-project pipeline).
  • Proposal came from gitlab-ce#3743 (GitLab Pipeline).
  • First-class triggers: gitlab-ce#16556.
  • Link between project pipeline views: gitlab-ce#22550
  • Consolidated view of entire pipeline across projects: gitlab-ce#22558
  • Cross-project build artifacts dependencies: gitlab-ce#14728

Documentation

The page on how to trigger pipelines (https://docs.gitlab.com/ee/ci/triggers/) should be refactored to describe that there is now an additional way to trigger pipelines using the .gitlab-ci.yml, in addition to using the API.

Edited Dec 10, 2018 by Dimitrie Hoekstra
Assignee
Assign to
11.8
Milestone
11.8 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#8997