forked from hyperledger-archives/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·60 lines (44 loc) · 1.19 KB
/
script.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
#!/bin/bash
# Exit on first error, print all commands.
set -ev
set -o pipefail
# Grab the parent (root) directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
ME=`basename "$0"`
echo ${ME} `date`
source ${DIR}/build.cfg
if [ "${ABORT_BUILD}" = "true" ]; then
echo "-#- exiting early from ${ME}"
exit ${ABORT_CODE}
fi
# Start the X virtual frame buffer used by Karma.
if [ -r "/etc/init.d/xvfb" ]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
fi
# are we building the docs?
if [ "${DOCS}" != "" ]; then
cd "${DIR}/packages/composer-website"
npm install
if [ -n "${TRAVIS_TAG}" ]; then
export JEKYLL_ENV=production
npm run full:prod
else
npm run full:unstable
fi
# Are we running system tests?
elif [ "${SYSTEST}" != "" ]; then
# Run the system tests.
${DIR}/packages/composer-systests/scripts/run-system-tests.sh
# We must be running unit tests.
else
# Run the unit tests.
npm test 2>&1 | tee
# Build the Composer UI.
cd "${DIR}/packages/composer-ui"
npm run build:prod
# Build the Composer Playground.
cd "${DIR}/packages/composer-playground"
npm run build:prod
fi
echo ${ME} `date`