This component generates a GitLab pipeline file and executes it in your pipeline. It will create an automatic commit when the content of the file changes.
Usage
- Create an empty pipeline file in your repository, for example
pipeline.generated.yml: - Create GitLab pipeline file
.gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/pipeline-generator@stable
inputs:
file: pipeline.generated.yml
script: |-
echo "[info] Generating pipeline"
mkdir -p $(dirname $PIPELINE_FILE) || true
echo "" > $PIPELINE_FILE
echo "somejob:" >> $PIPELINE_FILE
echo " stage: test" >> $PIPELINE_FILE
echo " script:" >> $PIPELINE_FILE
echo " - echo Hello, World!" >> $PIPELINE_FILE
- local: pipeline.generated.yml
rules:
- exists:
- pipeline.generated.yml
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| file | pipeline.generated.yml | string | |
| name | pipeline | string | |
| needs | The jobs that this job depends on. | [] | array |
| rules | The jobs that this job depends on. | [{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}] | array |
| script | string | ||
| stage | The pipeline stage that the jobs belongs to. | .pre | string |