在Gitlab中,我正在尝试从父管道触发子管道。子管道位于同一项目的子目录下。然而,在合并请求事件时,它会出现错误:“无法创建下游管道,该管道没有阶段/作业”。
文件夹结构:
- 命名空间/项目/.gitlab-ci.yml(父管道)
- 命名空间/项目/服务名称/.gitlab-ci.yml(子管道)
trigger_servicename:
stage: triggers
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"'
changes:
- app-notifier/*
when: always
trigger:
include: servicename/.gitlab-ci.yml
strategy: depend
子流水线:
image:
name: registry.gitlab.com/who-docker/aws-cli:latest
entrypoint:
- /usr/bin/env
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
stages:
-build
build:
stage: build
script:
- echo "run build..."
test:
stage: test
script:
- echo "run test...."