gitlab-ci-local
gitlab-ci-local copied to clipboard
Jobs with trigger, should automatically spawn the generated pipeline
This missing feature can be "circumvented" by using the --file parameter
gitlab-ci-local
gitlab-ci-local --file yml-generated-by-first-run.yml
I'm not sure if this is why I can't trigger pipelines.
I'm trying to do something like
.gitlab-ci.yml
trigger_job:
variables:
MY_VAR: world
trigger:
include: path/to/local-pipeline.yml
`path/to/local-pipeline.yml``
child-job:
script:
- echo "Hello $MY_VAR"
I would expect the jobs in the child pipeline to run and echo "Hello world" I don't understand how this workaround would help with trigger jobs.
Variables aren't passed as normal, since the trigger instruction isn't implemented yet..
Right. I see. Thanks for confirming that.
Hello Is it in your plans to add this feature here?
@firecow perhaps with a rough description of what needs to be done this could be implemented by someone else :) Would you be be able to give a rough outline of how one a would go about this?
We need to implement code in gitlab-ci-local that understands the Gitlab CI/CD trigger
keyword.
Things to consider
- Print trigger identifier on each log output line
- Make sure variables from one pipeline can be passed to the child pipeline
- Read and understand Gitlab CI/CD docs about triggered pipelines https://docs.gitlab.com/ee/ci/pipelines/downstream_pipelines.html
We are not interested in supporting that gitlab-ci-local
can trigger pipelines in other projects, but child pipelines should be doable.
Here is an example that should be working, when this feature is implemented.
variables:
VERSION: "1.0.0"
staging:
variables:
ENVIRONMENT: staging
stage: deploy
trigger:
include:
- local: path/to/child-pipeline.yml