Skip to content

Commit 52eb876

Browse files
authored
Netlify deploy preview (#78)
1 parent 924542f commit 52eb876

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

netlify_preview_build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# DESCRIPTION
3+
# for build JBake project on Netlify
4+
#
5+
# USAGE
6+
# Assume the root directory of your git repository is the root
7+
# directory of your JBake project.
8+
# On Netlify, set `Build Cmd` to `sh build.sh [JBake_version]`,
9+
# then Netlify will build your JBake project with the JBake version
10+
# you specified.
11+
#
12+
# For example, if you want to build the project with JBake v2.4.0,
13+
# just set `sh build.sh 2.4.0` in `Build Cmd`.
14+
#
15+
# If you don't specify the version number, i.e. `sh build.sh`,
16+
# then the latest JBake version is used.
17+
#
18+
# CREDIT
19+
# https://github.com/Mushiyo/netilfy-jbake-example-project-groovy
20+
#
21+
if [ $# -eq 0 ]
22+
then # if no argument passed in, set jBake to latest version
23+
jbake_version=2.3.1
24+
else
25+
jbake_version=$1
26+
fi
27+
echo "downloading JBake v$jbake_version"
28+
wget --quiet https://github.com/jbake-org/jbake/releases/download/v$jbake_version/jbake-$jbake_version-bin.zip
29+
echo "unzipping JBake v$jbake_version"
30+
unzip -o -q jbake-$jbake_version-bin.zip
31+
jbake-$jbake_version/bin/jbake -b

0 commit comments

Comments
 (0)