Add cross-project `dependencies` and `triggers` to .gitlab-ci.yml
Description including problem, use cases, benefits, and/or goals
As a developer, I want to be able to trigger CI build and test on one component after completing tests on another component. e.g. make a change to the API, then trigger tests on the front-end to make sure the front-end integration tests still succeed, and be able to mark items as dependent on each other.
Developers need to be able to link projects together to trigger CI to run on one project after CI succeeds on another project.
dependencies: - repository: gitlab-org/gitlab-ce on: master - repository: gitlab-org/gitlab-ee on: master build_ce: script: - build-omnibus-ce $GITLAB_CE_TRIGGERED_SHA build_ee: script: - build-omnibus-ee $GITLAB_EE_TRIGGERED_SHA
Triggers could work as follows:
We currently support triggers via the API, but to use it in a .gitlab-ci.yml requires ugly CURLing and passing secure tokens. We can simplify that process by providing some higher-level construct. Total rough draft:
test_front_end: stage: test trigger: project: gitlab-org/front-end vars: api_ref: $CI_BUILD_REF only: - tags
I'm not sure how passing references should work. It's probably common to need to know the ref of the upstream build, so maybe we just pass that automatically with some convention. But we probably need to support passing other variables too.
One problem with this is the token. The current API expects you to have pre-generated tokens for the downstream project, but as a user, I'd like to be able to just specify the project name and let some other permission system allow the transaction.
Links / references
- Originally from #933 (closed) (Multi-project pipeline).
- Proposal came from gitlab-ce#3743 (closed) (GitLab Pipeline).
- First-class triggers: gitlab-ce#16556 (closed).
- Link between project pipeline views: gitlab-ce#22550 (closed)
- Consolidated view of entire pipeline across projects: gitlab-ce#22558 (closed)
- Cross-project build artifacts dependencies: gitlab-ce#14728