Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bc7830c0c | ||
|
|
150591eb75 | ||
|
|
417311e9fb | ||
|
|
6fe12abbb5 | ||
|
|
bb27a06da9 | ||
|
|
068145b46e | ||
|
|
c5442f9754 | ||
|
|
07c36b7e6f | ||
|
|
b2b39c86f1 | ||
|
|
0a0e6c3140 | ||
|
|
007acf952a | ||
|
|
28275d777d |
@@ -1,6 +1,6 @@
|
|||||||
# dokku redis [](https://travis-ci.org/dokku/dokku-redis) [](https://webchat.freenode.net/?channels=dokku)
|
# dokku redis [](https://travis-ci.org/dokku/dokku-redis) [](https://webchat.freenode.net/?channels=dokku)
|
||||||
|
|
||||||
Official redis plugin for dokku. Currently defaults to installing [redis 5.0.5](https://hub.docker.com/_/redis/).
|
Official redis plugin for dokku. Currently defaults to installing [redis 5.0.7](https://hub.docker.com/_/redis/).
|
||||||
|
|
||||||
## requirements
|
## requirements
|
||||||
|
|
||||||
|
|||||||
2
config
2
config
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
export REDIS_IMAGE=${REDIS_IMAGE:="redis"}
|
export REDIS_IMAGE=${REDIS_IMAGE:="redis"}
|
||||||
export REDIS_IMAGE_VERSION=${REDIS_IMAGE_VERSION:="5.0.5"}
|
export REDIS_IMAGE_VERSION=${REDIS_IMAGE_VERSION:="5.0.7"}
|
||||||
export REDIS_ROOT=${REDIS_ROOT:="$DOKKU_LIB_ROOT/services/redis"}
|
export REDIS_ROOT=${REDIS_ROOT:="$DOKKU_LIB_ROOT/services/redis"}
|
||||||
export REDIS_HOST_ROOT=${REDIS_HOST_ROOT:=$REDIS_ROOT}
|
export REDIS_HOST_ROOT=${REDIS_HOST_ROOT:=$REDIS_ROOT}
|
||||||
|
|
||||||
|
|||||||
11
functions
11
functions
@@ -93,7 +93,16 @@ service_export() {
|
|||||||
local PASSWORD="$(service_password "$SERVICE")"
|
local PASSWORD="$(service_password "$SERVICE")"
|
||||||
|
|
||||||
[[ -n $SSH_TTY ]] && stty -opost
|
[[ -n $SSH_TTY ]] && stty -opost
|
||||||
docker exec "$SERVICE_NAME" bash -c "echo SAVE | redis-cli -a ${PASSWORD}" >/dev/null 2>&1
|
LASTSAVE1=$(docker exec "$SERVICE_NAME" bash -c "echo LASTSAVE | redis-cli -a ${PASSWORD}")
|
||||||
|
docker exec "$SERVICE_NAME" bash -c "echo BGSAVE | redis-cli -a ${PASSWORD}" >/dev/null 2>&1
|
||||||
|
LASTSAVE2=$(docker exec "$SERVICE_NAME" bash -c "echo LASTSAVE | redis-cli -a ${PASSWORD}")
|
||||||
|
|
||||||
|
until [[ "$LASTSAVE1" != "$LASTSAVE2" ]];
|
||||||
|
do
|
||||||
|
LASTSAVE2=$(docker exec "$SERVICE_NAME" bash -c "echo LASTSAVE | redis-cli -a ${PASSWORD}")
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
docker exec "$SERVICE_NAME" cat /data/dump.rdb
|
docker exec "$SERVICE_NAME" cat /data/dump.rdb
|
||||||
status=$?
|
status=$?
|
||||||
[[ -n $SSH_TTY ]] && stty opost
|
[[ -n $SSH_TTY ]] && stty opost
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku redis service plugin"
|
description = "dokku redis service plugin"
|
||||||
version = "1.9.0"
|
version = "1.10.1"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -11,20 +11,20 @@ teardown() {
|
|||||||
|
|
||||||
@test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" {
|
@test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" {
|
||||||
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
||||||
assert_contains "${lines[*]}" "l redis:5.0.5 running - -"
|
assert_contains "${lines[*]}" "l redis:5.0.7 running - -"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" {
|
@test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" {
|
||||||
dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242
|
dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242
|
||||||
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
||||||
assert_contains "${lines[*]}" "l redis:5.0.5 running 6379->4242 -"
|
assert_contains "${lines[*]}" "l redis:5.0.7 running 6379->4242 -"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "($PLUGIN_COMMAND_PREFIX:list) with linked app" {
|
@test "($PLUGIN_COMMAND_PREFIX:list) with linked app" {
|
||||||
dokku apps:create my_app
|
dokku apps:create my_app
|
||||||
dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app
|
dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app
|
||||||
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
run dokku "$PLUGIN_COMMAND_PREFIX:list"
|
||||||
assert_contains "${lines[*]}" "l redis:5.0.5 running - my_app"
|
assert_contains "${lines[*]}" "l redis:5.0.7 running - my_app"
|
||||||
dokku --force apps:destroy my_app
|
dokku --force apps:destroy my_app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
[[ $TRACE ]] && set -x
|
[[ $TRACE ]] && set -x
|
||||||
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 762E3157
|
||||||
|
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
|
||||||
|
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
|
||||||
if [[ "$DOKKU_VERSION" == "master" ]]; then
|
if [[ "$DOKKU_VERSION" == "master" ]]; then
|
||||||
sudo bash bootstrap.sh
|
sudo bash bootstrap.sh
|
||||||
@@ -13,9 +17,10 @@ export DOKKU_LIB_ROOT="/var/lib/dokku"
|
|||||||
export DOKKU_PLUGINS_ROOT="$DOKKU_LIB_ROOT/plugins/available"
|
export DOKKU_PLUGINS_ROOT="$DOKKU_LIB_ROOT/plugins/available"
|
||||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
|
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
|
||||||
sudo rm -rf "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX"
|
sudo rm -rf "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX"
|
||||||
sudo mkdir -p "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX" "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/subcommands"
|
sudo mkdir -p "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX" "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/subcommands" "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/scripts"
|
||||||
sudo find ./ -maxdepth 1 -type f -exec cp '{}' "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX" \;
|
sudo find ./ -maxdepth 1 -type f -exec cp '{}' "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX" \;
|
||||||
sudo find ./subcommands -maxdepth 1 -type f -exec cp '{}' "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/subcommands" \;
|
[[ -d "./scripts" ]] && sudo find ./scripts -maxdepth 1 -type f -exec cp '{}' "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/scripts" \;
|
||||||
|
[[ -d "./subcommands" ]] && sudo find ./subcommands -maxdepth 1 -type f -exec cp '{}' "$DOKKU_PLUGINS_ROOT/$PLUGIN_COMMAND_PREFIX/subcommands" \;
|
||||||
sudo mkdir -p "$PLUGIN_CONFIG_ROOT" "$PLUGIN_DATA_ROOT"
|
sudo mkdir -p "$PLUGIN_CONFIG_ROOT" "$PLUGIN_DATA_ROOT"
|
||||||
sudo dokku plugin:enable "$PLUGIN_COMMAND_PREFIX"
|
sudo dokku plugin:enable "$PLUGIN_COMMAND_PREFIX"
|
||||||
sudo dokku plugin:install
|
sudo dokku plugin:install
|
||||||
|
|||||||
Reference in New Issue
Block a user