From b1e5298be053e185b59a350d511ee7541b197058 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 13:19:34 -0700 Subject: [PATCH 1/8] feat: upgrade to 5.0.5 --- README.md | 2 +- config | 2 +- tests/service_list.bats | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d5f2cef..3616fd1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # dokku redis [![Build Status](https://img.shields.io/travis/dokku/dokku-redis.svg?branch=master "Build Status")](https://travis-ci.org/dokku/dokku-redis) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) -Official redis plugin for dokku. Currently defaults to installing [redis 5.0.4](https://hub.docker.com/_/redis/). +Official redis plugin for dokku. Currently defaults to installing [redis 5.0.5](https://hub.docker.com/_/redis/). ## requirements diff --git a/config b/config index d6cbf85..303153e 100755 --- a/config +++ b/config @@ -1,6 +1,6 @@ #!/usr/bin/env bash export REDIS_IMAGE=${REDIS_IMAGE:="redis"} -export REDIS_IMAGE_VERSION=${REDIS_IMAGE_VERSION:="5.0.4"} +export REDIS_IMAGE_VERSION=${REDIS_IMAGE_VERSION:="5.0.5"} export REDIS_ROOT=${REDIS_ROOT:="$DOKKU_LIB_ROOT/services/redis"} export REDIS_HOST_ROOT=${REDIS_HOST_ROOT:=$REDIS_ROOT} diff --git a/tests/service_list.bats b/tests/service_list.bats index c85c2e0..7afd66b 100755 --- a/tests/service_list.bats +++ b/tests/service_list.bats @@ -11,20 +11,20 @@ teardown() { @test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" { run dokku "$PLUGIN_COMMAND_PREFIX:list" - assert_contains "${lines[*]}" "l redis:5.0.4 running - -" + assert_contains "${lines[*]}" "l redis:5.0.5 running - -" } @test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" { dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242 run dokku "$PLUGIN_COMMAND_PREFIX:list" - assert_contains "${lines[*]}" "l redis:5.0.4 running 6379->4242 -" + assert_contains "${lines[*]}" "l redis:5.0.5 running 6379->4242 -" } @test "($PLUGIN_COMMAND_PREFIX:list) with linked app" { dokku apps:create my_app dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app run dokku "$PLUGIN_COMMAND_PREFIX:list" - assert_contains "${lines[*]}" "l redis:5.0.4 running - my_app" + assert_contains "${lines[*]}" "l redis:5.0.5 running - my_app" dokku --force apps:destroy my_app } From f2342ed6fc06fca4d109f9ca83ac094210147384 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 13:36:41 -0700 Subject: [PATCH 2/8] feat: upgrade busybox to 1.31.0-uclibc --- install | 2 +- subcommands/destroy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index ba5ca99..922b0f8 100755 --- a/install +++ b/install @@ -20,7 +20,7 @@ plugin-install() { pull-docker-image "dokku/ambassador:0.2.0" pull-docker-image "dokku/wait:0.3.0" pull-docker-image "dokku/s3backup:0.9.4" - pull-docker-image "busybox:1.30.1-uclibc" + pull-docker-image "busybox:1.31.0-uclibc" mkdir -p "$PLUGIN_DATA_ROOT" || echo "Failed to create $PLUGIN_SERVICE data directory" chown dokku:dokku "$PLUGIN_DATA_ROOT" diff --git a/subcommands/destroy b/subcommands/destroy index 57afc65..5b5d776 100755 --- a/subcommands/destroy +++ b/subcommands/destroy @@ -45,7 +45,7 @@ service-destroy-cmd() { service_container_rm "$SERVICE" dokku_log_verbose_quiet "Removing data" - docker run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/config:/config" busybox:1.30.1-uclibc chmod 777 -R /config /data + docker run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/config:/config" busybox:1.31.0-uclibc chmod 777 -R /config /data rm -rf "$SERVICE_ROOT" dokku_log_info2 "$PLUGIN_SERVICE container deleted: $SERVICE" From 46bd7f534f4d2a09be2aaca75fcd70655c3e0d0b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 14:31:47 -0700 Subject: [PATCH 3/8] feat: update ambassador, s3backup, and wait images --- common-functions | 4 ++-- functions | 2 +- install | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common-functions b/common-functions index d770be5..d325166 100755 --- a/common-functions +++ b/common-functions @@ -217,7 +217,7 @@ service_backup() { fi # shellcheck disable=SC2086 - docker run --rm $BACKUP_PARAMETERS dokku/s3backup:0.9.4 + docker run --rm $BACKUP_PARAMETERS dokku/s3backup:0.10.0 } service_backup_auth() { @@ -657,7 +657,7 @@ service_port_unpause() { echo "${PORTS[@]}" >"$PORT_FILE" # shellcheck disable=SC2046 - docker run -d --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" --name "$EXPOSED_NAME" $(docker_ports_options "${PORTS[@]}") --restart always --label dokku=ambassador --label "dokku.ambassador=$PLUGIN_COMMAND_PREFIX" dokku/ambassador:0.2.0 >/dev/null + docker run -d --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" --name "$EXPOSED_NAME" $(docker_ports_options "${PORTS[@]}") --restart always --label dokku=ambassador --label "dokku.ambassador=$PLUGIN_COMMAND_PREFIX" dokku/ambassador:0.3.0 >/dev/null if [[ "$LOG_FAIL" == "true" ]]; then dokku_log_info1 "Service $SERVICE exposed on port(s) [container->host]: $(service_exposed_ports "$SERVICE")" fi diff --git a/functions b/functions index 7f8c7f9..5050ee8 100755 --- a/functions +++ b/functions @@ -80,7 +80,7 @@ service_create_container() { echo "$ID" >"$SERVICE_ROOT/ID" dokku_log_verbose_quiet "Waiting for container to be ready" - docker run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" dokku/wait:0.3.0 -p "$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null + docker run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" dokku/wait:0.4.0 -p "$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null dokku_log_info2 "$PLUGIN_SERVICE container created: $SERVICE" service_info "$SERVICE" diff --git a/install b/install index 922b0f8..17237b4 100755 --- a/install +++ b/install @@ -17,9 +17,9 @@ plugin-install() { } pull-docker-image "${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION}" - pull-docker-image "dokku/ambassador:0.2.0" - pull-docker-image "dokku/wait:0.3.0" - pull-docker-image "dokku/s3backup:0.9.4" + pull-docker-image "dokku/ambassador:0.3.0" + pull-docker-image "dokku/wait:0.4.0" + pull-docker-image "dokku/s3backup:0.10.0" pull-docker-image "busybox:1.31.0-uclibc" mkdir -p "$PLUGIN_DATA_ROOT" || echo "Failed to create $PLUGIN_SERVICE data directory" From ba5b90349b9cde51897ee76298d4e92f236e401f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 14:32:49 -0700 Subject: [PATCH 4/8] chore: reorder images --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index 17237b4..8b347f9 100755 --- a/install +++ b/install @@ -17,10 +17,10 @@ plugin-install() { } pull-docker-image "${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION}" - pull-docker-image "dokku/ambassador:0.3.0" - pull-docker-image "dokku/wait:0.4.0" - pull-docker-image "dokku/s3backup:0.10.0" pull-docker-image "busybox:1.31.0-uclibc" + pull-docker-image "dokku/ambassador:0.3.0" + pull-docker-image "dokku/s3backup:0.10.0" + pull-docker-image "dokku/wait:0.4.0" mkdir -p "$PLUGIN_DATA_ROOT" || echo "Failed to create $PLUGIN_SERVICE data directory" chown dokku:dokku "$PLUGIN_DATA_ROOT" From 86e7d53749a6483d5012f9c4215aa943ad344eb9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 16:34:35 -0700 Subject: [PATCH 5/8] chore: move to helper functions for fetching passwords --- common-functions | 20 ++++++++++++++++++++ functions | 7 ------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/common-functions b/common-functions index d325166..08a6c6f 100755 --- a/common-functions +++ b/common-functions @@ -586,6 +586,26 @@ service_parse_args() { shift "$((OPTIND - 1))" # remove options from positional parameters } +service_password() { + declare desc="Fetch the password for a service" + declare SERVICE="$1" + local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" + local PASSWORD_FILE="$SERVICE_ROOT/PASSWORD" + if [[ -f "$PASSWORD" ]]; then + cat "$PASSWORD_FILE" + fi +} + +service_root_password() { + declare desc="Fetch the root password for a service" + declare SERVICE="$1" + local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" + local PASSWORD_FILE="$SERVICE_ROOT/ROOTPASSWORD" + if [[ -f "$PASSWORD" ]]; then + cat "$PASSWORD_FILE" + fi +} + service_port_expose() { declare desc="Wrapper for exposing service ports" declare SERVICE="$1" diff --git a/functions b/functions index 5050ee8..2e9bc1a 100755 --- a/functions +++ b/functions @@ -142,13 +142,6 @@ service_start() { fi } -service_password() { - local SERVICE="$1" - local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" - local PASSWORD="$(cat "$SERVICE_ROOT/PASSWORD")" - echo "$PASSWORD" -} - service_url() { local SERVICE="$1" local PASSWORD="$(service_password "$SERVICE")" From b3eb9ed0851595a8de5646b944f4db28fdd49309 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jul 2019 16:35:06 -0700 Subject: [PATCH 6/8] chore: update build targets --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e263f95..28d2958 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ dist: trusty language: bash env: - DOKKU_VERSION=master - - DOKKU_VERSION=v0.14.0 - - DOKKU_VERSION=v0.12.0 + - DOKKU_VERSION=v0.17.0 install: make setup script: make test after_failure: make report From 5849f1f19f0b29c6b91e9e001c0792026b863131 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Jul 2019 12:56:37 -0700 Subject: [PATCH 7/8] fix: use correct variable for checking for password file --- common-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-functions b/common-functions index 08a6c6f..f9ccfe4 100755 --- a/common-functions +++ b/common-functions @@ -591,7 +591,7 @@ service_password() { declare SERVICE="$1" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local PASSWORD_FILE="$SERVICE_ROOT/PASSWORD" - if [[ -f "$PASSWORD" ]]; then + if [[ -f "$PASSWORD_FILE" ]]; then cat "$PASSWORD_FILE" fi } @@ -601,7 +601,7 @@ service_root_password() { declare SERVICE="$1" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local PASSWORD_FILE="$SERVICE_ROOT/ROOTPASSWORD" - if [[ -f "$PASSWORD" ]]; then + if [[ -f "$PASSWORD_FILE" ]]; then cat "$PASSWORD_FILE" fi } From 77573a97ffe90106acbfccf2803536b068847075 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Jul 2019 13:43:57 -0700 Subject: [PATCH 8/8] chore: increase vm.max_map_count This is mainly used for elasticsearch but adding it to the generic test suite for all datastore plugins makes it easier to copy the travis config to each plugin. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 28d2958..812a515 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,6 @@ env: - DOKKU_VERSION=master - DOKKU_VERSION=v0.17.0 install: make setup +before_script: sudo sysctl -w vm.max_map_count=262144 script: make test after_failure: make report