aboutsummaryrefslogtreecommitdiff
path: root/scripts/watch
blob: d2e78d7b646acd24db5ff56315c8aa2a0b6589ea (plain)
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
33
34
35
36
37
38
#!/usr/bin/env bash
#
# Inotify builder
#

# Parameters
BASENAME="`basename $0`"
DIRNAME="$(cd `dirname $0` &> /dev/null && pwd)"
BASEDIR="$DIRNAME/.."
WATCHED="docs"

# Load existing .env file
if [ -e "$BASEDIR/.env" ]; then
  source $BASEDIR/.env
fi

# Configuration
FOLDER="${FOLDER:-/srv/shared}"
VM="${VM:-}"

# Got to the base folder, to make sure an empty VM
# would resolve to the local kvmxfile
cd $BASEDIR

# Built-in implementation
#
# Dispatch
#while inotifywait -r $WATCHED; do
#  #mkdocs build
#  kvmx ssh $VM make -C $FOLDER compile
#done

# Implementation based on the inotifier script
#inotifier $WATCHED mkdocs build
#inotifier $WATCHED kvmx ssh $VM make -C $FOLDER compile

# Implementation based on KVMX
kvmx inotify $VM $WATCHED make -C $FOLDER compile