Add insecure options (#36)

To push to a private registry via HTTP, the the following option where added:

* **insecure**: `push images to a plain HTTP registry`
* **insecure-pull**: `pull images from a plain HTTP registry`
* **insecure-registry**: `se plain HTTP requests when accessing the specified registry`
This commit is contained in:
teekay 2024-09-05 19:27:06 +09:00 committed by GitHub
parent 82815bb80c
commit 247dc9bb1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -38,3 +38,6 @@ Settings can be defined using the `settings` option for woodpecker plugins. All
| `skip-tls-verify` | `false` | ignore tls issues |
| `mirrors` | _none_ | set docker hub mirrors |
| `json-key` | _none_ | pass a json key to kaniko |
| `insecure` | `false` | push images to a plain HTTP registry. |
| `insecure-pull` | `false` | pull images from a plain HTTP registry. |
| `insecure-registry` | _none_ | use plain HTTP requests when accessing the specified registry. |

View file

@ -59,6 +59,18 @@ if [ "${PLUGIN_SKIP_TLS_VERIFY:-}" = "true" ]; then
EXTRA_OPTS=$(concatenate_strings "${EXTRA_OPTS}" '--skip-tls-verify=true')
fi
if [ "${PLUGIN_INSECURE:-}" = "true" ]; then
EXTRA_OPTS=$(concatenate_strings "${EXTRA_OPTS}" '--insecure=true')
fi
if [ "${PLUGIN_INSECURE_PULL:-}" = "true" ]; then
EXTRA_OPTS=$(concatenate_strings "${EXTRA_OPTS}" '--insecure-pull=true')
fi
if [ -n "${PLUGIN_INSECURE_REGISTRY:-}" ]; then
EXTRA_OPTS=$(concatenate_strings "${EXTRA_OPTS}" "--insecure-registry=${PLUGIN_INSECURE_REGISTRY}")
fi
if [ "${PLUGIN_CACHE:-}" = "true" ]; then
CACHE="--cache=true"
fi