Allow skip-tls-verify option for testing

This commit is contained in:
Tomasz Cholewa 2019-08-05 15:32:48 +02:00 committed by Nándor István Krácser
parent 4340afa523
commit 3da5de27d7
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ steps:
repo: registry.example.com/example-project repo: registry.example.com/example-project
tags: ${DRONE_COMMIT_SHA} tags: ${DRONE_COMMIT_SHA}
cache: true cache: true
skip_tls_verify: false # set to true for testing registries ONLY with self-signed certs
build_args: build_args:
- COMMIT_SHA=${DRONE_COMMIT_SHA} - COMMIT_SHA=${DRONE_COMMIT_SHA}
- COMMIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL} - COMMIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL}

View File

@ -28,11 +28,16 @@ fi
DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile} DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile}
CONTEXT=${PLUGIN_CONTEXT:-$PWD} CONTEXT=${PLUGIN_CONTEXT:-$PWD}
LOG=${PLUGIN_LOG:-info} LOG=${PLUGIN_LOG:-info}
EXTRA_OPTS=""
if [[ -n "${PLUGIN_TARGET:-}" ]]; then if [[ -n "${PLUGIN_TARGET:-}" ]]; then
TARGET="--target=${PLUGIN_TARGET}" TARGET="--target=${PLUGIN_TARGET}"
fi fi
if [[ "${PLUGIN_SKIP_TLS_VERIFY:-}" == "true" ]]; then
EXTRA_OPTS="--skip-tls-verify=true"
fi
if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then
CACHE="--cache=true" CACHE="--cache=true"
fi fi
@ -54,6 +59,7 @@ fi
/kaniko/executor -v ${LOG} \ /kaniko/executor -v ${LOG} \
--context=${CONTEXT} \ --context=${CONTEXT} \
--dockerfile=${DOCKERFILE} \ --dockerfile=${DOCKERFILE} \
${EXTRA_OPTS} \
${DESTINATIONS} \ ${DESTINATIONS} \
${CACHE:-} \ ${CACHE:-} \
${TARGET:-} \ ${TARGET:-} \