-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·49 lines (36 loc) · 1.06 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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
mkdir -p ./site ./temp;
BUILD_REPOS=./temp/build_repos.txt;
./bin/build-repos > $BUILD_REPOS;
BUILD_PATHS=./temp/build_paths.txt;
./bin/build-paths > $BUILD_PATHS;
# Scripts
INITIALISE_REPO=./scripts/initialise_repo.sh;
COPY_BRANCH=./scripts/copy_branch.sh;
BUILD_SITE="node build.js";
COPY_SITE=./scripts/copy_site.sh;
echo "Checking Repositories";
cat $BUILD_REPOS | while read line ; do $INITIALISE_REPO $line; done;
echo;
echo "Copying Branches Before Building";
cat $BUILD_PATHS | while read line ; do $COPY_BRANCH $line; done;
echo;
echo "Removing algolia.json";
rm -v algolia.json algolia-ref.json || echo 'algolia.json not present';
echo;
echo "Run Pre-build For All Branches";
node pre_build.js;
echo;
echo "Building Sites";
cat $BUILD_PATHS | while read line ; do $BUILD_SITE $line; done;
echo;
echo "Copying To Site After Builds";
cat $BUILD_PATHS | while read line ; do $COPY_SITE $line; done;
echo;
echo "Creating sitemap index";
./bin/create-sitemap-index;
echo;
echo "Algolia search index update";
./bin/update-algolia-index;
echo;
echo "Complete";