Closed danielzzz closed 8 months ago
This is due to a "not-so-smart" file detection we implemented. It's scheduled to be removed in the next major version https://github.com/firecow/gitlab-ci-local/discussions/335#discussion-3724247
Use the more explicit variable declaration style see this
global:
KEYSTORE:
type: variable
values:
'*': |
/u3+7QAAAAIAAAABAAAAAQADa2V5AAABUc51cjEAAAUDMIIE/zAOBgorBgEEASoCEQEBBQAEggTr
HwKjYqy9zlglEirKbkOEF8hnmQbUwS1j0X+1eiEd6sudeasZGOeOzCQ/mPQT/aleCxOtendSbJqp
l+yKROV+L7ANGCxzauC0qSPd5W1XnjU30hOov0uYKfb6Kk7XY7irVJ/qPCdT3Hh0fc2idMXsFhJl
...rest of the code
is it possible to use this syntax in gitlab-ci-local-variables.yml ? or just in .gitlab-ci-local/variables.yml
this syntax is giving me an error in the former
What have you tried so far?
basically, I copied your code to the file, both with and without the "global" section. but neither worked..
it did work when I copied the file to the project .gitlab-ci-local directory as variables.yml but I would rather avoid using it this way, as often I have to delete this dir due to conflicts with the locally executed code
Show me exactly what your are doing š¤£ I'm not following
ok, I have a repository, with a .gitlab-local.ci.yml file it's an android app and I want to use a base64 encoded keystore as a variable
but when I use it like this:
KEYSTORE: |
/u3+7QAAAAIAAAABAAAAAQADa2V5AAABUc51cjEAAAUDMIIE/zAOBgorBgEEASoCEQEBBQAEggTr
HwKjYqy9zlglEirKbkOEF8hnmQbUwS1j0X+1eiEd6sudeasZGOeOzCQ/mPQT/aleCxOtendSbJqp
l+yKROV+L7ANGCxzauC0qSPd5W1XnjU30hOov0uYKfb6Kk7XY7irVJ/qPCdT3Hh0fc2idMXsFhJl
...rest of the code
it's not working. it returns a file path, but then the file cannot be read.
global:
KEYSTORE:
type: variable
values:
'*': |
did not work... it's giving this error:
![image](https://github.com/firecow/gitlab-ci-local/assets/351916/cf87e3cc-89b3-45dd-96eb-44d15478a296)
3. the only way it worked was when I copied it to the .gitlab-local-ci directory that is created by gcl and put it in the variables.yml file
4. but this does not work for me, because I have to delete this .gitlab-local-ci dir often as it conflicts with some other scripts. for example yarn/gradle detects all the code inside it and complains about duplicates when I run it locally without gcl
so my question is, how / if could I use this extended format you sent in the normal .gitlab-local-ci.yml file, please?
I hope I could explain myself. thanks in advance for your help!
global:
KEYSTORE:
type: variable
values:
'*': |
Isn't what i postef.
Identation is important in ~/.gitlab-ci-local/variables.yml
global:
KEYSTORE:
You can use the HOME variables or the PROJECT variables to solve your problems.
https://github.com/firecow/gitlab-ci-local?tab=readme-ov-file#home-file-variables
https://github.com/firecow/gitlab-ci-local?tab=readme-ov-file#project-file-variables
sorry, that's true. I pasted it not correctly.
but I want to use it in a project file, and it seems this format is not working there. I mean with the "global" keyword or using the KEYSTORE variable directly with type and value keys.
would you please kindly confirm that or is it possible to use type/value also in proyect file vars?
Where do you place you .gitlab-ci-local-variables.yml
file exactly ?
It needs to be placed in your projects root, right next to .gitlab-ci.yml
KEYSTORE:
type: variable
values:
'*': |
sorry and thank you for you patience, it was a formatting problem on my side. fixed.
Hello, I am having this strange problem:
I am using a multiline local variable, which is a base64 encoded keystore for android:
the problems:
Expected behavior I would expect KEYSTORE to be an env variable in this case and I would like to be able to actually read it.
Host information Ubuntu gitlab-ci-local 4.46.0