-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-extract
More file actions
executable file
·32 lines (24 loc) · 873 Bytes
/
post-extract
File metadata and controls
executable file
·32 lines (24 loc) · 873 Bytes
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
28
29
30
31
32
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
trigger-dokkufile-post-extract() {
declare desc="apply dokkufile.yml from app repo before build"
declare trigger="post-extract"
declare APP="$1" TMP_WORK_DIR="$2" REV="$3"
local PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
local BINARY="$PLUGIN_DIR/dokkufile-bin"
local DOKKUFILE="$TMP_WORK_DIR/dokkufile.yml"
if [[ ! -f "$DOKKUFILE" ]]; then
return
fi
dokku_log_info1 "dokkufile.yml found, applying configuration..."
if ! "$BINARY" validate "$DOKKUFILE"; then
dokku_log_fail "dokkufile.yml validation failed"
fi
if ! "$BINARY" apply "$DOKKUFILE"; then
dokku_log_fail "dokkufile.yml apply failed"
fi
dokku_log_info1 "dokkufile.yml applied successfully"
}
trigger-dokkufile-post-extract "$@"