How to set up files as env vars in GitLab?

Viewed 803

I went throught the docs here, but I still can't figure out how to:

  1. Upload a file
  2. Specify the file name
  3. Specify destination for where it should be written during CI/CD

enter image description here

1 Answers

CI Variables of type file are very useful, but so far i have not found a way to upload a file. I was only able to store the content as the value.

GitLab CI will provide a Environment variable with the configured key (accessible in you case with ${filename.keystore}) which will point to a temporary created file (the path to the file). This means the variable will not contain the content of the file, but the path to it.

Our use case are Deploy Keys, which we store as File CI Variable and can easily reference in SSH configurations.

Related