-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateDocker.bash
117 lines (74 loc) · 2.93 KB
/
updateDocker.bash
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo ''
echo "This script must be run with sudo."
echo ''
exit 1
fi
echo "Which Docker image do you want to build?"
echo "1. FoldAffinity and MoltenProt"
echo "2. ThermoAffinity"
echo "3. PhotoMol"
echo "4. Raynals"
echo "5. ChiraKit"
read -p "Enter your choice [1-5]: " choice
askIfTestsWereDone () {
echo ''
read -p "Did you run the test $1 from the testing folder (y/n)?" CONT
if [ "$CONT" != "y" ]; then echo 'update aborted' && exit ; fi
}
askIfInfoWasUpdated () {
read -p "Did you add a new function to load a different kind of input file (y/n)?" CONT2
if [ "$CONT2" = "y" ]; then
echo -e ' \nOkay... Did you check that'
echo -e ' 1) There is an example file available in the corresponding www folder?'
echo -e ' 2) The user documentation was updated?'
echo -e ' 3) The user guide was updated?\n'
read -p "Would you like to continue (y/n)?" CONT3
if [ "$CONT3" != "y" ]; then exit ; fi
fi
}
printMessageHowToTestDocker () {
echo -e "\nTo test $1 in the developer machine run $ sudo docker run -p 3838:3838 $2"
echo -e "and then open http://localhost:3838/ in your browser"
}
case $choice in
1)
#askIfTestsWereDone 'testFoldAffinity.py and testMoltenProt.py'
#askIfInfoWasUpdated
echo -e "\nBuilding Image for FoldAffinity and MoltenProt..."
docker build -t spc_apps_docker_container -f ./dockerFiles/Dockerfile_differentialScanningFluorimetry .
printMessageHowToTestDocker 'MoltenProt' 'spc_apps_docker_container'
;;
2)
#askIfTestsWereDone 'testThermoAffinity.py'
#askIfInfoWasUpdated
echo -e "\nBuilding Image for ThermoAffinity..."
docker build -t thermo_affinity -f ./dockerFiles/Dockerfile_microscaleThermophoresis .
printMessageHowToTestDocker 'ThermoAffinity' 'thermo_affinity'
;;
3)
#askIfTestsWereDone 'testPhotoMol.py'
#askIfInfoWasUpdated
echo -e "\nBuilding Image for PhotoMol..."
docker build -t photo_mol -f ./dockerFiles/Dockerfile_massPhotometry .
printMessageHowToTestDocker 'PhotoMol' 'photo_mol'
;;
4)
#askIfTestsWereDone 'testRaynals.py'
#askIfInfoWasUpdated
echo -e "\nBuilding Image for Raynals..."
docker build -t raynals -f ./dockerFiles/Dockerfile_dynamicLightScattering .
printMessageHowToTestDocker 'Raynals' 'raynals'
;;
5)
#askIfTestsWereDone 'testRaynals.py'
#askIfInfoWasUpdated
echo -e "\nBuilding Image for Circular dichroism..."
docker build -t chirakit -f ./dockerFiles/Dockerfile_circularDichroism .
printMessageHowToTestDocker 'ChiraKit' 'chirakit'
;;
*)
echo "Invalid choice. Please select a valid option [1-5]."
;;
esac