最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

continuous integration - How can I define custom stages in a GitLab CICD pipeline using an external YAML file? - Stack Overflow

programmeradmin1浏览0评论

I have the below config in .gitlab-ci.yml

include:
- local: 'ci/jobs.yml'

stages:
- build
- deploy

build_job:
    stage: build
    script: echo "Building the project..."

ci/jobs.yml

stages:
- pre-build

pre_job:
  stage: pre-build
  script:
    - echo "Running some pre build stuff..."

When I run the pipeline, it throws the below error:

Unable to create pipeline
pre_job job: chosen stage pre-build does not exist; available stages are .pre, build, deploy, .post

Why does it say that the stage pre-build doesnt exist even though i have defined it in ci/jobs.yml? Shouldn't it be a valid stage after the configs get merged?

I added pre-job to .gitlab-ci.yml directly and removed the include. This works as expected.

发布评论

评论列表(0)

  1. 暂无评论