forked from hyperledger-archives/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·94 lines (73 loc) · 2.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Exit on first error, print all commands.
set -ev
set -o pipefail
# Bring in the standard set of script utilities
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
source ${DIR}/.travis/base.sh
# ----
env | grep TRAVIS
# 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
# Change into the docs directory.
cd "${DIR}/packages/composer-website"
# Build the documentation.
npm run doc
if [ -z "${BUILD_FOCUS}" ]; then
_exit 'No build focus' 1
fi
if [ "${BUILD_RELEASE}" = 'unstable' ]; then
if [ "${BUILD_FOCUS}" = 'latest' ]; then
BUILD_LABEL='unstable'
else
BUILD_LABEL="${BUILD_FOCUS}-unstable"
fi
elif [ "${BUILD_RELEASE}" = 'stable' ]; then
BUILD_LABEL="${BUILD_FOCUS}"
else
_exit "Unknown build release: ${BUILD_RELEASE}" 1
fi
npm run full -- "${BUILD_LABEL}"
npm run linkcheck -- "${BUILD_LABEL}"
# Are we running functional verification tests?
elif [ "${FVTEST}" != "" ]; then
# Run the fv tests.
${DIR}/packages/composer-tests-functional/scripts/run-fv-tests.sh
# append to the previous line to get duration timestamps.... | gnomon --real-time=false
# Are we running playground e2e tests?
elif [ "${INTEST}" == "e2e" ]; then
# Run the playground e2e tests.
cd "${DIR}/packages/composer-playground"
npm run e2e:main
# Are we running integration tests?
elif [ "${INTEST}" != "" ]; then
# Run the integration tests.
${DIR}/packages/composer-tests-integration/scripts/run-integration-tests.sh
# append to the previous line to get duration timestamps.... | gnomon --real-time=false
# We must be running unit tests.
else
# Run the unit tests.
npm test 2>&1
# Build the Composer Playground.
cd "${DIR}/packages/composer-playground"
npm run build:prod
fi
_exit "All complete" 0