Predefined CI variables for the dependency proxy
Problem to solve
The dependency proxy is intended to be heavily used with CI. However users need to define their own variables or hardcode some values into their scripts.
User experience goal
Provide some intuitive predefined variables for users to easily work with in CI scripts
Although we can use many of the existing predefined variables like:
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_SERVER_HOST":"$CI_SERVER_PORT" docker pull "$CI_SERVER_HOST":"$CI_SERVER_PORT"/groupname/dependency_proxy/containers/alpine:latest
it would be better to use variables specific to the dependency proxy even if they are just aliases.
I propose the following variables:
CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIXthe full group url with no protocol that could be found in the dependency proxy page for the group, for example:
CI_DEPENDENCY_PROXY_SERVERfor use in
docker login, the base host with no protocol, but including the port
This would allow the above commands to be used like:
docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_DEPENDENCY_PROXY_SERVER" docker pull "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX"/alpine:latest
CI_DEPENDENCY_PROXY_GROUP_URL variable being the most beneficial since it is not possible to build it using other existing variables.