forked from zalando/restful-api-guidelines
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sh
executable file
·38 lines (28 loc) · 1.19 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
#!/usr/bin/env bash
# Script to build Pon Guidelines (static HTML, PDF)
set -ex
./check_rule_ids.sh
pushd $(dirname "$0") > /dev/null
SCRIPT_DIR=`pwd -P`
popd > /dev/null
BUILD_DIR=${SCRIPT_DIR}/output
rm -rf ${BUILD_DIR}
mkdir "${BUILD_DIR}"
if command -v docker &> /dev/null
then
docker pull asciidoctor/docker-asciidoctor
docker run -v "${SCRIPT_DIR}:/documents/" asciidoctor/docker-asciidoctor asciidoctor --verbose --trace -D /documents/output index.adoc
docker run -v "${SCRIPT_DIR}:/documents/" asciidoctor/docker-asciidoctor asciidoctor-pdf --verbose --trace -D /documents/output index.adoc
# docker run -v ${SCRIPT_DIR}:/documents/ asciidoctor/docker-asciidoctor asciidoctor-epub3 --verbose --trace -D /documents/output index.adoc
else
gem install asciidoctor
gem install asciidoctor-pdf
asciidoctor --verbose --trace -D ${BUILD_DIR} index.adoc
asciidoctor-pdf --verbose --trace -D ${BUILD_DIR} index.adoc
fi
cp models/money-1.0.0.yaml "${BUILD_DIR}/"
cp -r assets "${BUILD_DIR}/"
# cp -r -n legacy/* ${BUILD_DIR}/
./generate_rules_json.sh
mv "${BUILD_DIR}/index.pdf" "${BUILD_DIR}/pon-guidelines.pdf"
# mv ${BUILD_DIR}/index.epub ${BUILD_DIR}/pon-guidelines.epub