-
Notifications
You must be signed in to change notification settings - Fork 23
/
install
executable file
·27 lines (21 loc) · 1.14 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
install_cmd() {
local DOKKU_LOGSPOUT_ROOT="$DOKKU_ROOT/.logspout"
local DOKKU_LOGSPOUT_OPTIONS="$DOKKU_LOGSPOUT_ROOT/OPTS"
local DOKKU_LOGSPOUT_ENVIRONMENT_VARIABLES="$DOKKU_LOGSPOUT_ROOT/ENV"
local DOKKU_LOGSPOUT_DEFAULT_PORT=18000
local DOKKU_LOGSPOUT_DEFAULT_IMAGE_VERSION=v3.2.6
local DOKKU_LOGSPOUT_PORT=${DOKKU_LOGSPOUT_PORT:=$DOKKU_LOGSPOUT_DEFAULT_PORT}
local DOKKU_LOGSPOUT_IMAGE_VERSION=${DOKKU_LOGSPOUT_IMAGE_VERSION:=$DOKKU_LOGSPOUT_DEFAULT_IMAGE_VERSION}
mkdir -p "$DOKKU_LOGSPOUT_ROOT"
[[ ! -f $DOKKU_LOGSPOUT_OPTIONS ]] && echo "export DOKKU_LOGSPOUT_PORT=$DOKKU_LOGSPOUT_PORT" > "$DOKKU_LOGSPOUT_OPTIONS"
[[ ! -f $DOKKU_LOGSPOUT_ENVIRONMENT_VARIABLES ]] && touch "$DOKKU_LOGSPOUT_ENVIRONMENT_VARIABLES"
if ! (grep -q DOKKU_LOGSPOUT_IMAGE_VERSION "$DOKKU_LOGSPOUT_OPTIONS"); then
echo "export DOKKU_LOGSPOUT_IMAGE_VERSION=$DOKKU_LOGSPOUT_IMAGE_VERSION" >> "$DOKKU_LOGSPOUT_OPTIONS"
fi
chown -R dokku:dokku "$DOKKU_LOGSPOUT_ROOT"
source "$DOKKU_LOGSPOUT_OPTIONS"
docker pull "gliderlabs/logspout:${DOKKU_LOGSPOUT_IMAGE_VERSION}"
}
install_cmd "$@"