forked from fabric8-ui/fabric8-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cico_run_tests.sh
executable file
·49 lines (38 loc) · 1.02 KB
/
cico_run_tests.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
#!/bin/bash
# Show command before executing
set -x
# Exit on error
set -e
# We need to disable selinux for now, XXX
/usr/sbin/setenforce 0
# Get all the deps in
yum -y install \
docker \
make \
git
service docker start
# Build builder image
docker build -t fabric8-ui-builder -f Dockerfile.builder .
mkdir -p dist && docker run --detach=true --name=fabric8-ui-builder -t -v $(pwd)/dist:/dist:Z fabric8-ui-builder
# Build almighty-ui
docker exec fabric8-ui-builder npm install
## Exec unit tests
docker exec fabric8-ui-builder ./run_unit_tests.sh
if [ $? -eq 0 ]; then
echo 'CICO: unit tests OK'
./upload_to_codecov.sh
else
echo 'CICO: unit tests FAIL'
exit 1
fi
## Exec functional tests
docker exec fabric8-ui-builder ./run_functional_tests.sh
## All ok, build prod version
if [ $? -eq 0 ]; then
echo 'CICO: functional tests OK'
docker exec fabric8-ui-builder npm run build:prod
## docker exec -u root fabric8-ui-builder cp -r /home/fabric8/fabric8-ui/dist /
else
echo 'CICO: functional tests FAIL'
exit 1
fi