This repository was archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path_run_jekyll.sh
executable file
·52 lines (43 loc) · 1.69 KB
/
_run_jekyll.sh
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
45
46
47
48
49
50
51
#!/bin/bash
if [ -z "$WRKDIR" ]
then
echo Environment WRKDIR is not set, setting it to current working directory
WRKDIR=`pwd`
export WRKDIR
fi
echo "Generating documentation from '$WRKDIR'..."
sed '/^\[.*\[.*\].*\]/d' $WRKDIR/documentation-generator/_references.md > $WRKDIR/documentation-generator/new_references.md
mv $WRKDIR/documentation-generator/new_references.md $WRKDIR/documentation-generator/_references.md
mkdir $WRKDIR/documentation-generator/pages
cp -r $WRKDIR/documentation/* $WRKDIR/documentation-generator/pages
cd $WRKDIR/documentation-generator
# rvm commands are insane scripts which pollut output
# so instead of set -x we just echo each command ourselves
set +x
if [ -e "/home/jenkins/.rvm/scripts/rvm" ]; then
echo "+ /home/jenkins/.rvm/scripts/rvm"
source /home/jenkins/.rvm/scripts/rvm
elif [ -e "$HOME/.rvm/scripts/rvm" ]; then
echo "+ $HOME/.rvm/scripts/rvm"
source $HOME/.rvm/scripts/rvm
else
echo "ERROR: I couldn't source rvm from '/home/jenkins/.rvm/scripts/rvm' or '\$HOME/.rvm/scripts/rvm', probably jekyll won't work"
fi
echo "Latest jekyll run :$BUILD_ID" > $WRKDIR/output.log
echo "Based on latest git commit :$GIT_COMMIT" >> $WRKDIR/output.log
echo "*********************************************************" >> $WRKDIR/output.log
echo "* CONSOLE OUTPUT *" >> $WRKDIR/output.log
echo "*********************************************************" >> $WRKDIR/output.log
set -x
jekyll
if [ "$?" -gt "0" ]; then
exit 1;
fi
$WRKDIR/documentation-generator/_scripts/cfdoc_postprocess.py "$@"
if [ "$?" -gt "0" ]; then
exit 2;
fi
$WRKDIR/documentation-generator/_scripts/_create_pdf.sh
if [ "$?" -gt "0" ]; then
exit 3;
fi