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.