forked from ClayLanzino/lucee-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·61 lines (47 loc) · 1.43 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
cd `dirname $0`
CWD="`pwd`"
echo "Starting Lucee5 server with which to build the docs..."
box server stop luceedocsbuilder
box start \
name="luceedocsbuilder" \
cfengine="lucee@5" \
port=8765 \
openbrowser=false \
directory=$CWD \
heapSize=1024;
echo "Done!";
echo "Importing reference docs from previously undocumented functions and tags..."
curl http://localhost:8765/import.cfm
echo "Building documentation (please be patient, it may take some time)..."
curl http://localhost:8765/build.cfm
echo "Stopping Lucee5 server..."
box server stop luceedocsbuilder
if [ -f .exitcode ]; then
exitcode=$(<.exitcode)
rm -f .exitcode
echo "Exiting build, documentation build failed. Exit code: $exitcode"
exit $exitcode
fi
echo "Building complete"
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] ; then
echo "Zipping up docs for offline download..."
cd builds/html
cp ../../.cloudfront-distribution-id ./
zip -q -r lucee-docs.zip *
cd ../../
echo "Zipped."
echo "Preparing dash artifacts..."
cp -r builds/html builds/artifacts
mkdir builds/artifacts/dash
cp builds/dash/lucee.xml builds/artifacts/dash/
cd builds/dash
tar -czf ../../builds/artifacts/dash/lucee.tgz lucee.docset
cd ../../
echo "Prepared."
echo "Syncing with S3..."
s3_website push
echo "All done :)"
fi
echo "Ping search engines with sitemaps"
curl https://google.com/ping?sitemap=https://docs.lucee.org/sitemap.xml