Running jobs conditionally using inputs that default to project variables
Summary
We are moving from templates to gitlab components and I'm trying to rewrite our current templates to use gitlab components such that the default behaviour of the template does not change.
Thus far I have failed to duplicate the behavior conditionally running jobs using inputs that default to values defined as project variables (Under Settings->CI/CD->Variables
) as opposed to conditionally running the jobs using just the project variables.
Definition of Done
Inputs that default to some project variable can be used in a rules: if
statement to run the job only if the input (or the project variable) is defined.
Example repository:
https://gitlab.com/rsoome/var_default_input_demo
In pipelines 5d62862c
(EXTERNAL_CONTAINER_REGISTRY undefined) and f27812ed
(EXTERNAL_CONTAINER_REGISTRY defined) you can see that debug_inputs
and debug_vars
jobs behave different whereas I'd expect them to behave identically.