Use enviorment variable file during cicd

Hello,

I’d like to use file environment variable during my cicd. I’ve tried as indicated here: https://docs.gitlab.com/ee/ci/variables/#custom-environment-variables-of-type-file but when I do this during build, I don’t have the temp file, only the path which points to nowhere.

How should I do to have all my file variables stored in the final build ?

Ideally, what I’d like to do, is to go through all my environment variables in gitlab, and for those prefixed with “FILE_”, export them in a dedicated folder (./app/settings/files) as separate file.

I’m doing something similar for my non-file environment variables like this, with an APP_ prefix for all the required env variable:

  • export | grep APP_ | sed -e ‘s/APP_//g’ | sed -e ‘s/declare -x //g’ > ./app/settings/.env

Thanks for your help