-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-and-deploy.sh
More file actions
executable file
·44 lines (37 loc) · 953 Bytes
/
generate-and-deploy.sh
File metadata and controls
executable file
·44 lines (37 loc) · 953 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
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
readonly PROGNAME=$(basename $0)
readonly PROGDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
readonly GULP="$PROGDIR/node_modules/gulp/bin/gulp.js"
readonly ARGS="$@"
readonly TARGET="$PROGDIR/_site"
readonly JEKYLL=`which jekyll`
readonly ENV_SRC="$PROGDIR/environment.sh"
if [[ ! -f $JEKYLL ]]; then
echo "Jekyll not found. Exiting..."
exit 1
fi
if [ ! -f $ENV_SRC ]; then
echo "$(basename $ENV_SRC) not found. Exiting..."
exit 1
fi
. $ENV_SRC
cd $PROGDIR
shopt -s globstar
rm -rf $TARGET
if [[ "$*" == *--no-process-content* ]]; then
echo "WARNING: Not processing content dir"
else
$GULP --env production processContent
fi
if [[ "$*" == *--no-gulp* ]]; then
echo "WARNING: No gulp pipeline"
else
$GULP --env production
fi
$JEKYLL build
rm -rf $TARGET/content
rm -f $TARGET/*.sh
rm -f $TARGET/*.iml
rm -rf $TARGET/sass
rm -rf $TARGET/node_modules
rsync -hrvz --checksum --stats $TARGET/ $SSH_HOST:$SSH_DIR/