Allow setting variable to a contents of a file
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
I need to be able to define image: for the job based on the contents of a file from git repository.
It is already possible to use variables for the image:, but it is not possible to define a variable to be equal to the contents of a file.
For example, if I have config/version.txt file in my repo, then I could write the following in gitlab-ci.yml:
variables:
img_ver:
file_contents: "config/version.txt"
image: mydockerhub/myimage:version_$img_ver
Other people on the internet are also interested about such feature:
Edited by 🤖 GitLab Bot 🤖