-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·29 lines (22 loc) · 962 Bytes
/
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
#!/bin/bash
set -e
COMPONENT=$1
PATH=$PATH:/root/.local/bin
#read samples
mkdir samples
aws --quiet s3 cp s3://dhtmlx-packages/${COMPONENT}/latest.txt ./
LATEST=`cat ./latest.txt`
aws --quiet s3 cp s3://dhtmlx-packages/${COMPONENT}/${COMPONENT}_${LATEST}_site.zip ./
unzip -q ./${COMPONENT}_${LATEST}_site.zip 'samples/*'
echo '{"samples":"./samples/"}' > madoka.local.json
#generate static docs
php index.php reindex
php -d memory_limit=512M index.php export_html
cd export && zip -qr ../${COMPONENT}.docs.html.zip ./ && cd ..
mkdir search
php -d memory_limit=512M index.php sphinx
cd search && zip -qr ../${COMPONENT}.docs.xml.zip ./ && cd ..
#store generated docs
aws --quiet s3 cp ./${COMPONENT}.docs.html.zip s3://dhtmlx-packages/docs/${COMPONENT}_${LATEST}.html.zip
aws --quiet s3 cp ./${COMPONENT}.docs.xml.zip s3://dhtmlx-packages/docs/${COMPONENT}_${LATEST}.xml.zip
aws --quiet s3 cp ./latest.txt s3://dhtmlx-packages/docs/${COMPONENT}.latest.txt