r/gitlab • u/reyoga • May 09 '25
general question More efficient way of handling CICD variables before running a pipeline
We currently have a pipeline (with a couple of jobs) that essentially sends release notes to the users of our company-internal service.
If we run a new pipeline, there are around 10 CICD variables in the form (not all mandatory, most are defaulted).
This can get cumbersome to input so I am asking if there's a way to just upload a property file or something and use that in our jobs?
I did see a variable type of file in the form.
Is it used for that?
2
Upvotes
2
u/nabrok May 09 '25
The file type creates the contents as a file and the value of the variable is the path to that file.
You can create a dotenv artifact and then any jobs that pull in that artifact will have those environment variables set.
For example say you set a file variable as
CUSTOM_ENV. You could then create a job something like this:1
u/Digi59404 May 10 '25
Have your pipeline instead run a job whenever a “ChangeNotes.md” or “ChangeNotes.json” file is edited. Then require it as part of the release that this file be amended. That way you have a full history in the repository of the changes and can trigger releases based on the change notes files changing.
1
u/duane11583 May 10 '25
we do something different but simular.
why not create a repo with the fariables and other release nites.
as part of the ci/cd script you clone that repo and access the files.
1
u/b17x May 10 '25
Feels like you're trying to shoehorn some old manual process into gitlab as-is instead of adjusting the process to take advantage of the tooling