forked from modmore/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·38 lines (30 loc) · 929 Bytes
/
deploy.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
#!/usr/bin/env bash
if [ -f .deploy_in_progress ];
then
echo "Deploy already in progress";
exit 0;
fi
touch .deploy_in_progress;
# Trick daux.io into thinking there's a zip file it can link to
if [ ! -f modmore-documentation.zip ];
then
touch modmore-documentation.zip;
fi
# Generate the docs using daux.io
if vendor/bin/daux generate --source=. --destination=html_tmp ; then
# Remove the empty placeholder file from the generated html folder
if [ -f html_tmp/modmore-documentation.zip ];
then
rm html_tmp/modmore-documentation.zip;
fi
# Generate a zip file containing the complete static site, placing it inside the html folder again
zip -r html_tmp/modmore-documentation.zip html_tmp;
# Remove the html folder
rm -rf html/;
mv html_tmp/ html;
rm .deploy_in_progress;
else
echo "Failed generating documentation";
rm .deploy_in_progress;
exit 1;
fi