@@ -3,5 +3,6 @@ dist: trusty
|
||||
language: bash
|
||||
env:
|
||||
- DOKKU_VERSION=master
|
||||
- DOKKU_VERSION=v0.4.14
|
||||
before_install: make setup
|
||||
script: make test
|
||||
|
||||
@@ -4,18 +4,13 @@ Official postgres plugin for dokku. Currently defaults to installing [postgres 9
|
||||
|
||||
## requirements
|
||||
|
||||
- dokku 0.4.0+
|
||||
- dokku 0.4.x+
|
||||
- docker 1.8.x
|
||||
|
||||
## installation
|
||||
|
||||
```shell
|
||||
# on 0.3.x
|
||||
cd /var/lib/dokku/plugins
|
||||
git clone https://github.com/dokku/dokku-postgres.git postgres
|
||||
dokku plugins-install
|
||||
|
||||
# on 0.4.x
|
||||
# on 0.4.x+
|
||||
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
|
||||
```
|
||||
|
||||
|
||||
11
commands
11
commands
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
|
||||
[[ " help $PLUGIN_COMMAND_PREFIX:help " == *" $1 "* ]] || [[ "$1" == "$PLUGIN_COMMAND_PREFIX:"* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
PLUGIN_BASE_PATH="$PLUGIN_PATH"
|
||||
@@ -6,13 +8,10 @@ if [[ -n $DOKKU_API_VERSION ]]; then
|
||||
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
|
||||
fi
|
||||
source "$PLUGIN_BASE_PATH/common/functions"
|
||||
source "$(dirname "$0")/functions"
|
||||
source "$(dirname "$0")/config"
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
|
||||
|
||||
if [[ $1 == $PLUGIN_COMMAND_PREFIX:* ]]; then
|
||||
if [[ ! -d $PLUGIN_DATA_ROOT ]]; then
|
||||
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugin:install"
|
||||
fi
|
||||
if [[ ! -d $PLUGIN_DATA_ROOT ]]; then
|
||||
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugin:install"
|
||||
fi
|
||||
|
||||
if [[ -d "$PLUGIN_DATA_ROOT/*" ]]; then
|
||||
|
||||
10
functions
10
functions
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname "$0")/config"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
get_random_ports() {
|
||||
@@ -317,8 +317,8 @@ service_url() {
|
||||
echo "$PLUGIN_SCHEME://postgres:$PASSWORD@$SERVICE_ALIAS:${PLUGIN_DATASTORE_PORTS[0]}/$DATABASE_NAME"
|
||||
}
|
||||
|
||||
is_container_status () {
|
||||
local CID=$1
|
||||
is_container_status() {
|
||||
local CID="$1"
|
||||
local TEMPLATE="{{.State.$2}}"
|
||||
local CONTAINER_STATUS=$(docker inspect -f "$TEMPLATE" "$CID" || true)
|
||||
|
||||
@@ -401,7 +401,7 @@ service_linked_apps() {
|
||||
}
|
||||
|
||||
update_plugin_scheme_for_app() {
|
||||
local APP=$1
|
||||
local POSTGRES_DATABASE_SCHEME=$(config_get $APP POSTGRES_DATABASE_SCHEME)
|
||||
local APP="$1"
|
||||
local POSTGRES_DATABASE_SCHEME=$(config_get "$APP" POSTGRES_DATABASE_SCHEME)
|
||||
PLUGIN_SCHEME=${POSTGRES_DATABASE_SCHEME:-$PLUGIN_SCHEME}
|
||||
}
|
||||
|
||||
6
install
6
install
@@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname "$0")/config"
|
||||
|
||||
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q "$PLUGIN_IMAGE_VERSION" ; then
|
||||
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
|
||||
fi
|
||||
|
||||
if ! docker images | grep -e "^svendowideit/ambassador "; then
|
||||
if ! docker images | grep -q -e "^svendowideit/ambassador "; then
|
||||
docker pull svendowideit/ambassador:latest
|
||||
fi
|
||||
|
||||
if ! docker images | grep -e "^dokkupaas/wait "; then
|
||||
if ! docker images | grep -q -e "^dokkupaas/wait "; then
|
||||
docker pull dokkupaas/wait:latest
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
PLUGIN_BASE_PATH="$PLUGIN_PATH"
|
||||
@@ -6,8 +7,7 @@ if [[ -n $DOKKU_API_VERSION ]]; then
|
||||
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
|
||||
fi
|
||||
source "$PLUGIN_BASE_PATH/common/functions"
|
||||
source "$(dirname "$0")/functions"
|
||||
source "$(dirname "$0")/config"
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
|
||||
|
||||
APP="$1"
|
||||
for SERVICE in "$PLUGIN_DATA_ROOT"/*; do
|
||||
|
||||
6
tests/bin/lsb_release
Executable file
6
tests/bin/lsb_release
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
echo "Darwin"
|
||||
else
|
||||
echo "Ubuntu"
|
||||
fi
|
||||
@@ -10,7 +10,11 @@ export PLUGIN_AVAILABLE_PATH="$PLUGIN_PATH"
|
||||
export PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH"
|
||||
export POSTGRES_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures"
|
||||
export PLUGIN_DATA_ROOT="$POSTGRES_ROOT"
|
||||
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz"
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_darwin_x86_64.tgz"
|
||||
else
|
||||
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz"
|
||||
fi
|
||||
|
||||
mkdir -p "$PLUGIN_DATA_ROOT"
|
||||
rm -rf "${PLUGIN_DATA_ROOT:?}"/*
|
||||
|
||||
Reference in New Issue
Block a user