-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow to provides connection through command line #4
Comments
I just have a few questions to be sure I understand your requirement: is your concern about having password stored in the "env" file, or do you want to avoid having files at all and specify everything through command line? For the first problem I was thinking about some inclusion mechanism so password could be moved out of env file, but maybe that doesn't solve your problem at all. Your idea about specifying options though command line is nice, the only drawback I see is that it requires some duplication between configuration file reading and command line parsing (each time a new option is added it must be added twice). Maybe this could be solved by accepting a JSON-serialized string in command line so that same deserialization mechanism can be used (e.g. What do you think? |
Sorry, I wasn't enough specific, I have concerns about either the password in file and the files themselves. To avoid the duplication, what about adding |
I think understand your concern, but not your last suggestion. Instead of passing new create_environment and create_definition options I suggested to directly use the data provided through command line without creating a file at all. For example Could that be an option in your case? |
I wasn't suggesting to create files from the command line arguments but rather to create If you prefer to stick to JSON in argument values I am ok with it, but if possible I's prefer if definition also had it's command line argument, since like all the files that I want to transfer through FTP are generated, I'd prefer not to store the Let me know If I am not clear enough 😄 |
Oh OK sorry then I probably didn't understand exactly your suggestion. Could you please give me an example of what your new command line options would look like? (I'm trying to understand how you would transform them into environment and definitions objects without having to duplicate schema declaration somewhere 😄 ) |
Sorry about the confusion, I should have done that from the beginning 😞 Hare is what I have in mind, something like that: creep --connection ftp://someftp/ --local --source hash Then in environment = factory.create_environment (args) And in def create_environment (args):
if args.connection != ""
return Environment (args.connection, args.local)
else
return Environement (args.environment_path) So this is just the general idea, I know that this is not usable as is. |
OK that's more or less what I had in mind, but I believe it has the problem I was trying to describe above: you expose separated parameters ( I don't have better solution to suggest though ; let me dig a bit more to see if there is a way to get the best of both approaches 😄 |
If nothing works out, the JSON approach will do the thing. |
I just published a 0.3.4 version on PyPi with support for extended Hopefully this new version will unblock your project in the meantime! Thanks again for your ideas 👍 |
Thanks, I will test it ASAP. 😃 |
Everything works fine for me. So you can close this or leave it open if you prefer to find a more convenient way. |
Good! I have no better solution for the moment so I'd rather close the issue, but I'm still open to any idea that would allow easier syntax with no configuration parsing code duplication. |
It seems the |
Ah sorry about that! It's actually not fully gone, but since configuration files were merged together there is now a single parameter to pass a configuration through a JSON string: creep -d '{"environment": {"default": {"connection": "your-connection-string-here"}}}' Does that work for you? |
Oh thanks, I didn't see that. |
I plan to use creep in a continuous delivery context, with the files generated during build on the CI server.
For example for my ReadingList project, I run a F# script on AppVeyor which generates some content and after I deploy the files on my FTP.
So right now, if I want to use creep to deploy the files, I need to provides the
.creep.env
and.creep.def
files, either by having them on git (but with the FTP password that's not really an option) or by generated them, which is not really practical.I was thinking to add more arguments to creep, like
connection
,local
,source
and maybealgorithm
andfollow
.The goal is not to replace the files, but more to allow a minimal use of creep without using any file.
If you are ok with this idea I will make a PR, tested on both Python 2 & 3 this time 😄
The text was updated successfully, but these errors were encountered: