Open thoefkens opened 1 year ago
"I have tried setting them in GLC_VARIABLES but that has no effect"
Show us how you tried using GCL_VARIABLE
I use a .envrc file where all environment variables get exported automatically once I go into my folder (where I run gitlab-ci-local).
export AWS_ACCESS_KEY_ID=xxxx
export AWS_SECRET_ACCESS_KEY=xxxx
export GLC_VARIABLES="AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx"
gitlab-ci-local --variable
It's called GCL_VARIABLE
Oh my bad... Thank you!
Actually @firecow , it still does not work. I tried "GCL_VARIABLE" as you said, that does not work. I then tried "GCL_VARIABLES" and when I set that, and run gitlab-ci-local, I get the error:
❯ gitlab-ci-local
Unknown argument: variables
BTW, the documentation in the readme is wrong apparently, that is why I put GLC_VARIABLES in the first place because it is described like that there. Thanks Thomas
I have the same problem, it looks to me like GCL_VARIABLE supports only one variable, GCL_VARIABLES doesn't exist, but if it did, it would solve the problem when you have more than one variable and need expansion, such as login + password.
Also one way to avoid all this would be to have variable expansion in .gitlab-ci-local-variables.yml for example
This would allow to have a proper local setup for everyone, overriding only a couple of user/pass/secret which are per user.
I've fixed the documentation here e96e0ff76a7a9bca2610e9bb7431250c6821e5cc
And yes, that needs fixing, sorry about that, will be fixed in a moment, if I can find the bug.
I've renamed the issue title, hope thats ok.
Found it, now I just need to come up with a fix.
@firecow can we merge the draft pr
@AbdulRashidReshamwala No, its in draft because its not ready yet :smile:
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior When I run gitlab-ci-local, Terraform fails to initialise against an AWS S3 backend (bucket). Normally this works fine when AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set correctly as env vars. (or in Gitlab itself in the CI CD Variables section). I have tried setting them in GLC_VARIABLES but that has no effect.
Host information MacOS gitlab-ci-local 4.43.0
Containerd binary Docker
BTW Works fine when I put them into .gitlab-ci-local-variables but would like to use ENV VAR GLC_VARIABLES as I work with dotenv a lot so I would not need to define them in different locations.