Read inputs from a single location
Following #415636 (comment 1588389396)
Problem
Users would like a way to avoid writing the same input parameter declarations in the components
Why
Users would like to maintain the input in a single location instead of replicating it over and over again
Each Component file requires input to be defined in the spec section, is there any way where we can define the inputs in one single file and then use it for every component? (Customer quote)
WIP Proposal
- The users are responsible configuring the file with the up-to-date values.
- Users should configure to read inputs from the file
- GitLab will use the file content to populate inputs
WIP example (feel free to revisit and change)
# components/my_component:
spec:
inputs:
my_file_inputs:
---
test:
script:
- echo $[[ inputs.my_file_inputs ]]
# my .gitlab-ci.yml
include:
- local: 'components/my_component'
inputs:
my_file_inputs: $[[ repository.file('inputs.abc.yaml').my_value ]] # Read input from a file
Edited by Dov Hershkovitch