feat: use custom env var to disable pull actions
This commit is contained in:
@@ -233,3 +233,9 @@ dokku mysql:backup-auth lolipop AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGI
|
|||||||
# more specific example for minio auth
|
# more specific example for minio auth
|
||||||
dokku mysql:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE
|
dokku mysql:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Disabling `docker pull` calls
|
||||||
|
|
||||||
|
If you wish to disable the `docker pull` calls that the plugin triggers, you may set the `MYSQL_DISABLE_PULL` environment variable to `true`. Once disabled, you will need to pull the service image you wish to deploy as shown in the `stderr` output.
|
||||||
|
|
||||||
|
Please ensure the proper images are in place when `docker pull` is disabled.
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ service_create() {
|
|||||||
service_parse_args "${@:2}"
|
service_parse_args "${@:2}"
|
||||||
|
|
||||||
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " ; then
|
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " ; then
|
||||||
|
if [[ "$MYSQL_DISABLE_PULL" == "true" ]]; then
|
||||||
|
dokku_log_warn "MYSQL_DISABLE_PULL environment variable detected. Not running pull command." 1>&2
|
||||||
|
dokku_log_warn " docker pull ${IMAGE}" 1>&2
|
||||||
|
dokku_log_warn "$PLUGIN_SERVICE service creation failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
|
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
5
install
5
install
@@ -5,6 +5,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
plugin-install() {
|
plugin-install() {
|
||||||
pull-docker-image() {
|
pull-docker-image() {
|
||||||
declare IMAGE="$1"
|
declare IMAGE="$1"
|
||||||
|
if [[ "$MYSQL_DISABLE_PULL" == "true" ]]; then
|
||||||
|
echo " ! MYSQL_DISABLE_PULL environment variable detected. Not running pull command." 1>&2
|
||||||
|
echo " ! docker pull ${IMAGE}" 1>&2
|
||||||
|
return
|
||||||
|
fi
|
||||||
if [[ "$(docker images -q "${IMAGE}" 2> /dev/null)" == "" ]]; then
|
if [[ "$(docker images -q "${IMAGE}" 2> /dev/null)" == "" ]]; then
|
||||||
docker pull "${IMAGE}"
|
docker pull "${IMAGE}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user