From 3da5de27d7637892f55ffedef01a253b6bc222f9 Mon Sep 17 00:00:00 2001 From: Tomasz Cholewa Date: Mon, 5 Aug 2019 15:32:48 +0200 Subject: [PATCH] Allow skip-tls-verify option for testing --- README.md | 1 + plugin.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index c58ba13..b622e31 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ steps: repo: registry.example.com/example-project tags: ${DRONE_COMMIT_SHA} cache: true + skip_tls_verify: false # set to true for testing registries ONLY with self-signed certs build_args: - COMMIT_SHA=${DRONE_COMMIT_SHA} - COMMIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL} diff --git a/plugin.sh b/plugin.sh index 5c76605..01f3989 100755 --- a/plugin.sh +++ b/plugin.sh @@ -28,11 +28,16 @@ fi DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile} CONTEXT=${PLUGIN_CONTEXT:-$PWD} LOG=${PLUGIN_LOG:-info} +EXTRA_OPTS="" if [[ -n "${PLUGIN_TARGET:-}" ]]; then TARGET="--target=${PLUGIN_TARGET}" fi +if [[ "${PLUGIN_SKIP_TLS_VERIFY:-}" == "true" ]]; then + EXTRA_OPTS="--skip-tls-verify=true" +fi + if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then CACHE="--cache=true" fi @@ -54,6 +59,7 @@ fi /kaniko/executor -v ${LOG} \ --context=${CONTEXT} \ --dockerfile=${DOCKERFILE} \ + ${EXTRA_OPTS} \ ${DESTINATIONS} \ ${CACHE:-} \ ${TARGET:-} \