forked from nergmada/planning-wiki
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·44 lines (39 loc) · 1.15 KB
/
build.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
################### BUILD ###########################
# This script should build the site for you, if you #
# are using it to test on your system you should #
# run it with the serve directive as shown below #
# #
# ./build.sh serve #
# #
# This should host the planning wiki on #
# 127.0.0.1:4000 #
#####################################################
# Your context should not be set, this is for our CI
echo "$CONTEXT"
# This is for CI only
if [ "$CONTEXT" = "branch-deploy" ]
then
echo "deploy branch"
bundle exec jekyll build --config _config_testing.yml
exit
fi
if [ "$CONTEXT" = "deploy-preview" ]
then
echo "deploy preview"
bundle exec jekyll build --config _config_testing.yml
exit
fi
bundle update
bundle install
if [ ! $? -eq 0 ]
then
#Looks like bundler didn't install something, probably should try it with ruby
sudo gem install
fi
# Should now build
if [ $1 = "serve" ]
then
bundle exec jekyll serve
else
bundle exec jekyll build
fi