-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerate_mr.sh
executable file
·63 lines (56 loc) · 1.71 KB
/
generate_mr.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
#!/bin/bash
cd $(dirname "$0") # Go to directory containing script
#if builded locally
if [ ! -d "testplan-to-mr" ]; then
cd ../../../../tools/testplan-to-mr
sudo docker build -t testplan-to-mr .
cd ../../testplans/spid-cie-oidc/implementations/spid-cie-oidc-django
fi
#Check if the flag exist
justFillFlag=""
djangoFlag=""
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--justFill)
if [[ -n "$2" ]]; then
justFillFlag="--justFill $2"
folder_path="$2"
shift 2
else
echo "Error: Missing argument for --justFill"
exit 1
fi
;;
--django)
djangoFlag="--django"
shift
;;
*)
echo "Error: Unknown option $key"
exit 1
;;
esac
done
#Add the volume only if exist
volume_mount=""
if [ -n "$justFillFlag" ]; then
volume_mount="-v ${PWD}/$folder_path:/testplan-to-mr/$folder_path"
fi
#First volume is for **/../testplan.csv** and **/config/testplan-to-mr/templates** input
#Second is for the **templates**
#Third is for **/config_testplan.json** input
#Fourth is for output of **/input/mig-t/tests/single** file
#Fifth is for output of **/input/mig-t/tests/manual** file
#Sixth is for output of **/input/mig-t/tests/configured_tests** tests
docker run \
--rm \
-v ${PWD}/../../testplan.csv:/testplan-to-mr/input/testplan.csv \
-v ${PWD}/../../config/testplan-to-mr/templates/:/testplan-to-mr/input/templates/ \
-v ${PWD}/config/testplan-to-mr:/testplan-to-mr/config_file/ \
-v ${PWD}/input/mig-t/tests/single:/testplan-to-mr/tests/single \
-v ${PWD}/input/mig-t/tests/manual:/testplan-to-mr/tests/manual \
-v ${PWD}/input/mig-t/configured_tests:/testplan-to-mr/configured_tests \
$volume_mount \
testplan-to-mr /bin/bash -c "python testplan-to-mr.py $justFillFlag $djangoFlag"
wait