-
-
Notifications
You must be signed in to change notification settings - Fork 156
/
sync-repositories.sh
executable file
·54 lines (42 loc) · 1.58 KB
/
sync-repositories.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
#!/usr/bin/env bash
MAIN_REPO_URL=https://github.com/sequelize/sequelize.git
ROOT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
DOCS_DIR="$ROOT_DIR/.sequelize"
API_DIR="$ROOT_DIR/static/api"
set -e
# Ensure API_DIR
mkdir -p "$API_DIR"
# ======================================
# Sequelize v7 (typedoc + docusaurus)
# Cloned to its own folder because the documentation can import some of its files at build time
# ======================================
# Clear generated directories
rm -rf "$DOCS_DIR/v7"
rm -rf "$API_DIR/v7"
# Get sources
git clone -b main --single-branch "$MAIN_REPO_URL" --depth 1 "$DOCS_DIR/v7"
pushd "$DOCS_DIR/v7"
yarn # Install branch deps & build
yarn build
yarn docs # Generate v7 typedocs
mv .typedoc-build "$API_DIR/v7" # Move compiled api reference
popd
# ======================================
# Sequelize v6 (esdoc + docusaurus)
# Cloned to its own folder because the documentation can import some of its files at build time
# ======================================
# Clear generated directories
rm -rf "$DOCS_DIR/v6"
rm -rf "$API_DIR/v6"
# Get sources
git clone -b v6 --single-branch "$MAIN_REPO_URL" --depth 1 .sequelize/v6
pushd "$DOCS_DIR/v6"
yarn global add node-gyp --ignore-engines
yarn --ignore-engines # Install branch deps & build
yarn docs # Generate v6 typedocs
mv esdoc "$API_DIR/v6" # Move compiled api reference
popd
# ======================================
# Sequelize v5 and lower
# The files are living inside the static directory and will just be copied over to the build directory at build time
# ======================================