ci: harden registry proxy credentials
This commit is contained in:
Vendored
+6
@@ -201,7 +201,10 @@ pipeline {
|
|||||||
--driver-opt network=host \
|
--driver-opt network=host \
|
||||||
--driver-opt "env.http_proxy=$HTTP_PROXY_URL" \
|
--driver-opt "env.http_proxy=$HTTP_PROXY_URL" \
|
||||||
--driver-opt "env.https_proxy=$HTTP_PROXY_URL" \
|
--driver-opt "env.https_proxy=$HTTP_PROXY_URL" \
|
||||||
|
--driver-opt "env.HTTP_PROXY=$HTTP_PROXY_URL" \
|
||||||
|
--driver-opt "env.HTTPS_PROXY=$HTTP_PROXY_URL" \
|
||||||
--driver-opt "env.no_proxy=reg.nxsir.cn" \
|
--driver-opt "env.no_proxy=reg.nxsir.cn" \
|
||||||
|
--driver-opt "env.NO_PROXY=reg.nxsir.cn" \
|
||||||
--use
|
--use
|
||||||
./scripts/ci-docker.sh buildx inspect "$BUILDER_NAME" --bootstrap
|
./scripts/ci-docker.sh buildx inspect "$BUILDER_NAME" --bootstrap
|
||||||
'''
|
'''
|
||||||
@@ -218,9 +221,12 @@ pipeline {
|
|||||||
)]) {
|
)]) {
|
||||||
sh '''
|
sh '''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
set +x
|
||||||
auth=$(printf '%s:%s' "$HARBOR_USERNAME" "$HARBOR_PASSWORD" | base64 -w0)
|
auth=$(printf '%s:%s' "$HARBOR_USERNAME" "$HARBOR_PASSWORD" | base64 -w0)
|
||||||
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "$REGISTRY_URL" "$auth" >"$DOCKER_CONFIG/config.json"
|
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "$REGISTRY_URL" "$auth" >"$DOCKER_CONFIG/config.json"
|
||||||
chmod 600 "$DOCKER_CONFIG/config.json"
|
chmod 600 "$DOCKER_CONFIG/config.json"
|
||||||
|
unset auth
|
||||||
|
set -x
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user