-
Notifications
You must be signed in to change notification settings - Fork 47
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 config of registry repo URLs with ENV #208
base: master
Are you sure you want to change the base?
Allow config of registry repo URLs with ENV #208
Conversation
Codecov Report
@@ Coverage Diff @@
## master #208 +/- ##
========================================
- Coverage 13.21% 6.51% -6.7%
========================================
Files 27 27
Lines 1256 1258 +2
========================================
- Hits 166 82 -84
- Misses 1090 1176 +86
Continue to review full report at Codecov.
|
There is an alternative to this, which is to do something like this in the Docker:
If you'd rather that I try that and see if that works before changing Registrator code, that's cool, I can try that this week and report back. |
# assign it a default one, obtained from ENV. | ||
if !haskey(target_registry, "repo") | ||
specific_env_key = string(uppercase(target_registry_name), "_REGISTRY_URL") | ||
envkey = ifelse(haskey(ENV, specific_env_key), specific_env_key, "DEFAULT_REGISTRY_URL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the next line can be simplified to:
target_registry["repo"] = get(ENV, specific_env_key, ENV["DEFAULT_REGISTRY_URL"])
This PR adds the ability to get the port from ENV for the WebUI.
It also addresses #74, by allowing URLs for registries to be specified through ENV.
This is useful for services like Heroku where the URL used for the repository contains the access token:
https://USER:[email protected]/User/Repo
.I'm not sure, but currently, I don't think the token field in
config.commentbot.toml
is actually used.Because providing an access token for this field, and then using a normal https URL for the registries results in authentication errors for me, whereas using repo urls of the form
https://USER:[email protected]/User/Repo
works fine.EDIT: I stand corrected, the token field is used, in parts of the comment bot where GitHub.jl is used, it's just seemingly not used when it comes to cloning the registry repo and doing the stuff Regedit/Registration service does.