-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --env-file-to-variables cli option #1332
Comments
What exactly are you trying to do ? I assume you are hoping to have a centralized place to defined the "gitlab variables" for your pipeline This might help help you |
I just want to pass a .env file variables. If you take an example on GitHub Act (a tool to run GitHub actions locally), we can pass .env path. The purpose for the .env is not just for gitlab testing but for everything. It's a standard. It would be great to have this on gitlab-ci-local |
I see, so you're requesting for the hard-coded path |
Thank you for you quick response !
|
Creating the following symbolic link should be a quick fix while waiting for this to be implemented ln -s .env .gitlab-ci-local-variables.yml |
Is it a env file or variables file you want to be able to specify the location of? Or both 😄 |
À .env preferably since it's the most used type of file to contain variables (in python) |
But what kind of values are you putting in your .env file that you want to pass to |
I want to pass all the variables . A .env file is not specific and contains many env variables that change when you switch projects |
I think you need to clarify very precisely what you want this feature to become in a new issue or here. Add very realworld like .env files and gitlab-ci.yml's n' such... Normally people put variables inside the |
Sorry but I don't know how to be clearer than this 😅 Here is an example of a .env file (this one is named .env.example but the true name is .env). It contains some environment variables that will be loaded https://github.com/platformsh-templates/laravel/blob/master/.env.example |
The variables inside a .env needs to have the "=" instead of ":". WHO="I like ...." But the idea is this . You are correct |
Are we talking about the .env file should be extrapolated into |
Yeah, I think this is where the confusion comes from, haha. I was wondering the same thing. I believe he's referring to |
This is why I wanted a precise .env file with real world contents 😄 |
I think it is better to write a little scenario for what I want I have a repository that contains somewhere a .env file (it is ignored in .gitignore) I run the gitlab ci local command with for example an argument : GCL_ENV_FILE=path/to/file/.env and I specify the path to the .env file Gitlab ci local will load inside my container the variables that are inside the .env If I do : echo $VARIABLE1 inside my gitlab ci local container, I will the the value of the variable that is inside the .env which means that it properly exported the variables inside the .env file |
Yes yes... We need a cli options called Rename the title to "Add --env-file-to-variables cli option" 😄 |
Glad that we finally understand each other 😂 |
i was thinking about something like this instead, https://github.com/firecow/gitlab-ci-local/pull/1355/files#diff-3d6e22f8e4281faf7d19dcacaf5fe63566f6ada084252104ef5f04b9c687e140R121-R123 what do you think ? if it's ok, i'll add some test cases for it |
https://github.com/firecow/gitlab-ci-local/pull/1355/files#diff-59b63d2cf1329cb81baf1d68651daaaa07d5c91e2062db5051bc9fed04488bf0R1 .env files doesn't look like this. Perhaps @AmineDjeghri at some point, would be so kind to provide an example |
ok just pushed the test, should be good now |
I would like to thank you first for working on this. I really do enjoy what you did with this tool. I already provided a link to a.env example. But here is a copy paste of that same file. As you can see, we can use quotes for string
|
I just updated to the latest version and i got this message when i tried to use the .env
edit: my bad. I just checked and the fix is not yet released i would like to suggest an update in the readme : #1379 |
@AmineDjeghri I'll get it released during the day |
Is your feature request related to a problem? Please describe.
Currently, I must store the .env file in one directory, limiting flexibility, and having to manager two separate .env files. I'd like to be able to specify the .env file's location via an environment variable so it can be used from any directory or path.
Describe the solution you'd like
add the option to define the path to the .env file using an environment variable, like this: export GCL_ENV_FILE=.env. This would allow the gitlab-ci-local command to use the .env file from any given path, regardless of its directory. This change would allow for more flexibility in working with multiple environments and project structures.
The text was updated successfully, but these errors were encountered: