0

I have a file called .auto.tfvars that I want to use to set some Terraform variables in an CI run, however when I try to add it, I get a popup called,

Variables key can contain only letters, digits and '_'.

Looking at the documentation for GitLab CI/CD variables, I don't see this restriction mentioned nor a workaround.

2 Answers 2

0

The GitLab file variable name isn't the path to the file. It's the name of an environmental variable that stores the path to the file. Either way you'll have to move the key to where you want the file stored.

Let's say you set this in the GitLab UI,

MYGITLAB_FILE_VARIABLE=contents

When that gets run MYGITLAB_FILE_VARIABLE will be some long and random path name on the runner. You'll have to run this in a CI job to get that file where you want.

mv $MYGITLAB_FILE_VARIABLE /my/desired/path
0

I used double __ and renamed them to dots during the pipeline process. Its not ideal but works

env |sed 's/__/./g' > application.properties

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.