GitLab CI " [u]se[s] the dependencies
keyword to define a list of specific jobs to fetch artifacts from."
I want to add a job from a GitLab CI/CD Component to the dependecies
but I’m getting an YAML invalid saying undefined dependency.
@fabiopitino can you help me? This is a bit similar to Gitlab Components using artefacts and job needs for order.
.gitlab-ci.yml
include:
- component: $CI_SERVER_FQDN/rse/docker/images/sphinx-doc/sphinx-doc@2.3.1
inputs:
stage: build
dir: docs
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- docs/source/**/*
pages:
stage: .post
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
dependencies:
- build sphinx website
script:
- echo Publish documentation to GitLab Pages
artifacts:
paths:
- public
Component
spec:
inputs:
stage:
default: build
description: Build the documentation.
dir:
default: docs
description: Relative directory where the Sphinx project is located.
job-name:
default: build sphinx website
description: Name of the job. This can be used for artifacts dependencies.
---
$[[ inputs.job-name ]]:
stage: $[[ inputs.stage ]]
image: docker-private.gesis.intra/rse/docker/images/sphinx-doc:2.3.1
script:
- cd $[[ inputs.dir ]]
- make html
- |
if [ -d _build ]
then
echo Found _build
mv _build/html ../public
else
echo Could NOT locate _build
fi
- |
if [ -d build ]
then
echo Found build
mv build/html ../public
else
echo Could NOT locate build
fi
artifacts:
paths:
- public
GitLab Server
I observer this with GitLab Community Edition v16.11.6.