-
Notifications
You must be signed in to change notification settings - Fork 26
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
Allows users to set a dependency mirror #563
Conversation
@sophiewigmore I've updated the description. Let me know if you have any questions. |
Do we need to add anything to deal with the username/password parts of the URI? and what about the file scheme ( |
If a username and password are included in the url, it's captured by |
@sophiewigmore I'll double check and get back to you. |
313d6cd
to
60ef82a
Compare
@sophiewigmore I did some adhoc/integration testing with the nginx buildpack, inserting
Usernames and passwords are handled by I've updated the PR to address all the above suggestions. |
60ef82a
to
b156c42
Compare
b156c42
to
0ca2742
Compare
0ca2742
to
5bfb0ee
Compare
Implements dependency-mirrors RFC
A new release of each buildpack will need to be cut with the updated version of packit containing this change.
Reason for this change:
While there is already support for dependency mappings, this adds support for dependency mirrors. The difference is the user would not need to specify a mapping for each individual dependency. Dependency mirrors are more efficient because the user can set one mirror for all or multiple dependencies.
The mirror can be set via an environment variable or a binding of type
dependency-mirror
. In addition, multiple mirror URLs can be set, a default mirror with extra specific hostname mirrors. For example, if a user wants to download all dependencies from the same place except for dependencies that originated in github (see below). The default mirror can contain a placeholder,{originalHost}
, to support mirrors that host many different repositories, which in some cases include the original hostname in the path. If only specific hostname mirrors are set, the appropriate dependencies will be download via those mirrors while everything else will be downloaded through the original URLs in the buildpack's metadata.Example mirrors via environment variables:
Example of mirrors via binding
If a dependency mapping and a dependency mirror is set, an error will be generated. Dependency mappings and mirrors cannot be used simultaneously.
If a binding is used to set dependency mirrors, there can only be one binding of type
dependency-mirror
, containing multipleEntries
for each mirror URL.If both methods, environment variable(s) and binding, are used to set a dependency mirror, the mirror(s) from the environment variable(s) will be chosen, as specified in the above RFC.