forked from wso2/msf4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·52 lines (47 loc) · 982 Bytes
/
run.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
#!/usr/bin/env bash
baseDir=$(dirname "$0")
vendorsLoc="$baseDir/Samples"
function cleanup(){
local vendors=$(ls "$vendorsLoc")
local type=""
local vendor=""
for vendor in $vendors
do
local vendorDir="$vendorsLoc/$vendor"
if [ -f "$vendorDir/run.sh" ]
then
local pidFile=$vendorDir/pid
if [ -f $pidFile ]
then
$vendorDir/run.sh "stop"
fi
fi
done
}
function buildSamples(){
local vendors=$(ls "$vendorsLoc")
local type=""
local vendor=""
for vendor in $vendors
do
local vendorDir="$vendorsLoc/$vendor"
if [ -f "$vendorDir/run.sh" ]
then
$vendorDir/run.sh "build"
fi
done
}
if [ "$1" = "build" ]
then
cleanup
buildSamples
else
cleanup
$baseDir/excecute-tests.sh
fi
if [ ! "$?" = 0 ]
then
echo "Test were not completed successfully"
echo "Cleaning up.."
cleanup
fi