forked from finos/legend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-site.sh
executable file
·62 lines (53 loc) · 1.42 KB
/
build-site.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
60
61
62
#!/bin/bash
# Define which models to embed in the site
export ALLOY_MODELS="purealloy-modeling purealloy-modeling-samples"
# Where the model MD files will be checked out
export DOCS_FOLDER=${PWD}/docs/models
# Import docs from modeling projects in gitlab.com/finos-foundation
cd /tmp
mkdir -p ${DOCS_FOLDER}
for ALLOY_MODEL in ${ALLOY_MODELS}
do
rm -rf ${ALLOY_MODEL}
git clone https://gitlab.com/finosfoundation/${ALLOY_MODEL}.git
mkdir -p ${DOCS_FOLDER}/${ALLOY_MODEL}
cp -Rf ${ALLOY_MODEL}/docs/* ${DOCS_FOLDER}/${ALLOY_MODEL}
done
cd -
# Create contribute.md docs page, from .github/CONTRIBUTING.md
CONTRIB_MD_PATH=docs/contribute.md
if [ -f ".github/CONTRIBUTING.md" ]; then
rm -rf $CONTRIB_MD_PATH
touch $CONTRIB_MD_PATH
cat <<EOT >> $CONTRIB_MD_PATH
---
id: contribute
title: Contributing to Alloy
sidebar_label: Contribute
---
EOT
# Remove title (first line) from MD file content
sed 1d .github/CONTRIBUTING.md >> $CONTRIB_MD_PATH
fi
# Create roadmap.md docs page, from .github/ROADMAP.md
ROADMAP_MD_PATH=docs/roadmap.md
if [ -f ".github/ROADMAP.md" ]; then
rm -rf $ROADMAP_MD_PATH
touch $ROADMAP_MD_PATH
cat <<EOT >> $ROADMAP_MD_PATH
---
id: roadmap
title: Alloy Roadmap
sidebar_label: Roadmap
---
EOT
# Remove title (first line) from MD file content
sed 1d .github/ROADMAP.md >> $ROADMAP_MD_PATH
fi
# Where the docusaurus app lives
cd website
# Install docusaurus deps
yarn install
# Build Docusaurus site
yarn build
cd -