Allow setting variable to a contents of a file
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 Ivan Gagis