Skip to content
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

[feature] Add support for custom server path via env or cli #9099

Merged

Conversation

jenia90
Copy link
Contributor

@jenia90 jenia90 commented Jun 14, 2021

Changelog: Feature: Added support for using server config from a custom location, setting CONAN_SERVER_HOME env variable or using -d or --server_dir flag when launching the server with conan_server command.
Docs: conan-io/docs#2125

When launching from the command line the new CLI flag will be prioritized over the environment variable, this is because we want to let the user test the server with custom dirs even if an env var has been set.
I've also added some tests to test the new feature (even though currently the tests are pretty basic).

Close #9098.

Please let me know if there are any improvements to be made :)

@CLAassistant
Copy link

CLAassistant commented Jun 14, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

conans/conan_server.py Outdated Show resolved Hide resolved
conans/server/server_launcher.py Show resolved Hide resolved
@memsharded memsharded requested a review from czoido June 14, 2021 13:40
@memsharded memsharded added this to the 1.38 milestone Jun 14, 2021
@jenia90 jenia90 changed the title Add support for custom server path via env or cli [feature] Add support for custom server path via env or cli Jun 14, 2021
conans/server/launcher.py Outdated Show resolved Hide resolved
conans/server/launcher.py Outdated Show resolved Hide resolved
conans/server/migrate.py Outdated Show resolved Hide resolved
@czoido
Copy link
Contributor

czoido commented Jun 14, 2021

I think I would prefer to have the server folder stored under the serve_folder/.conan_server insted of directly in server_dir to be more symmetric with the conan client, but that's just a personal opinion... so I would be ok with that.

@jenia90
Copy link
Contributor Author

jenia90 commented Jun 14, 2021

Hi @czoido
Thanks for the feedback, I'm resolving the issues that came up, so hopefully I will have a fix in a bit.
Regarding the folder location, initially I considered placing .conan_server folder inside the custom path, but then I thought that it would give the user more flexibility when choosing where to store their configs and data. If you or your team think it's better to place it under .conan_server inside the custom path, I'll happily make the relevant changes :)

@memsharded
Copy link
Member

I think I would prefer to have the server folder stored under the serve_folder/.conan_server insted of directly in server_dir to be more symmetric with the conan client, but that's just a personal opinion... so I would be ok with that.

Actually, this is something that will change in Conan 2.0, and the client side will be able to define directly the cache folder, without the extra .conan folder. So I am fine with it the way it is.

@jenia90 jenia90 requested a review from czoido June 14, 2021 19:08
@memsharded memsharded merged commit d683b13 into conan-io:develop Jun 15, 2021
@memsharded
Copy link
Member

Thanks for contributing this. If possible, it would be nice to do a PR to the docs repo to update the docs with this new feature. I think adding a couple of lines will be good enough. Then, update the TODO in the first comment, we automatically generate the changelog from there.

@jenia90 jenia90 deleted the feature/9098-custom_server_folder branch June 15, 2021 07:57
@jenia90
Copy link
Contributor Author

jenia90 commented Jun 15, 2021

Thanks for contributing this. If possible, it would be nice to do a PR to the docs repo to update the docs with this new feature. I think adding a couple of lines will be good enough. Then, update the TODO in the first comment, we automatically generate the changelog from there.

@memsharded, thank you for accepting my PR! To update the docs I need to create a new issue on the docs repo and then submit a PR, correct?

@memsharded
Copy link
Member

memsharded commented Jun 15, 2021

@memsharded, thank you for accepting my PR! To update the docs I need to create a new issue on the docs repo and then submit a PR, correct?

No need for the issue, this issue or PR is good enough for it, go directly for the PR.

@jenia90 jenia90 restored the feature/9098-custom_server_folder branch June 15, 2021 08:06
@jenia90 jenia90 deleted the feature/9098-custom_server_folder branch June 15, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Support for custom directory for conan_server
5 participants