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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for private registry #11766
Conversation
How would this work if the private registry doesn't require authentication? |
@jkenn99 @MikeMcQuaid |
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.
A few minor comments but I really like this approach. I like how non-invasive the approach is. Great work 馃憦馃徎
@@ -449,7 +449,7 @@ def resolve_url_basename_time_file_size(url, timeout: nil) | |||
return @resolved_info_cache[url] if @resolved_info_cache.include?(url) | |||
|
|||
if (domain = Homebrew::EnvConfig.artifact_domain) | |||
url = url.sub(%r{^((ht|f)tps?://)?}, "#{domain.chomp("/")}/") | |||
url = url.sub(%r{^((ht|f)tps?://ghcr.io/)?}, "#{domain.chomp("/")}/") |
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.
url = url.sub(%r{^((ht|f)tps?://ghcr.io/)?}, "#{domain.chomp("/")}/") | |
url = url.sub(%r{^(https?://#{GitHubPackages::URL_DOMAIN}/)?}, "#{domain.chomp("/")}/") |
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.
Agree, with 2 additional changes:
- Added the
o
flag to handle RuboCop error: https://msp-greg.github.io/rubocop-performance/RuboCop/Cop/Performance/ConstantRegexp.html - URL_DOMAIN constant became public
@jkenn99 Please try to be a little more positive on this PR given that someone else seems likely to implement the functionality that you weren't willing to push to completion. Thanks 鉂わ笍 |
Good call, my bad. |
@jkenn99 Thanks for understanding 馃挅 |
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 looks good to me! @yahavi can you confirm it all still works for you after the most recent changes and I think I'm good to merge.
@jkenn99 - It works for me on Artifactory 6.9 and above. @MikeMcQuaid - I confirm. Please merge. |
Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @yahavi! |
I just followed this PR - but thank all of you. |
@MikeMcQuaid thanks for merging this PR and for your kind words :) |
It seems like this merge has broken core CI, as noticed by @alebcay : https://github.com/Homebrew/homebrew-core/pull/81954/checks?check_run_id=3171769122
|
I'm getting the same error when trying to install a Cask with Homebrew 3.2.5-5-g250233a:
I don't see an open issue for this yet. |
@SMillerDev @ltm |
Thanks, @yahavi. I can confirm that #11782 fixes the issue for me:
|
@zie-ent We'll likely have a new release within a week (probably Monday). |
This was tagged in 3.2.6 |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Supersedes #11339
Partially addresses #11287
Allow using a private registry mirroring the common URL for blobs and bottles (https://ghcr.io/v2/homebrew/core). This feature worked before when the Homebrew packages registry was Bintray and this PR makes sure it works as before.
Usage example with Artifactory:
brew-remote
.HOMEBREW_DOCKER_REGISTRY_TOKEN
environment variable with Artifactory access token and HOMEBREW_ARTIFACT_DOMAIN with a URL to Artifactory repository: