Backend: Allow specifying the working directory for a child pipeline
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
workaround
cd into the working directory in the before_script
default:
before_script:
- cd xyz
Current status
This issue is currently blocked by #422871 which requires support from grouprunner
Proposal
As described on the forum, it doesn't seem to be possible to specify the working directory for a child pipeline. This can be quite inconvenient for mono-repos or (in my case) show-casing projects.
Example setup
.
├── example
│ ├── src
│ │ └── main.rs
│ ├── Cargo.toml
│ └── .gitlab-ci.yml
├── src
│ └── lib.rs
└── .gitlab-ci.yml
The root CI can test and build the actual project and then launch a child pipeline, that showcases the project and ensures that the example still works.
Another usecase: Here's a real-world attempt at trying to make Gitlab CI templates with examples
Possible implementation
Add a cwd, pwd, or working_directory key to trigger:
some job:
trigger:
working_directory: example
include: example/.gitlab-ci.yml