-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
65 lines (54 loc) · 1.47 KB
/
deploy.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
#!/bin/bash
webapps="."
appName="fournisseur-identite"
temp="./temp"
src="./src"
lib="./lib"
web="./web"
bin="./bin"
conf="./conf"
tempjava="./tempjava"
rm -f "../../tomcat/webapps/$appName"
rm -rf "$temp"
rm -rf "$tempjava"
mkdir -p "$temp"
mkdir -p "$tempjava"
mkdir -p "$temp/WEB-INF/lib"
mkdir -p "$temp/WEB-INF/classes"
if [ -d "$web" ]; then
cp -r "$web"/* "$temp/"
else
echo "Le répertoire web est introuvable"
fi
if [ -d "$lib" ]; then
cp -r "$lib"/* "$temp/WEB-INF/lib/"
else
echo "Le répertoire lib est introuvable"
fi
if [ -d "$src/controller" ] && [ -d "$src/model" ] && [ -d "$src/util" ] && [ -d "$src/connexion" ]; then
cp -r "$src"/controller/* "$tempjava"
cp -r "$src"/model/* "$tempjava"
cp -r "$src"/util/* "$tempjava"
cp -r "$src"/connexion/* "$tempjava"
else
echo "Les répertoires src/controller, src/model, src/connexion ou src/util sont introuvables"
fi
echo "Contenu de tempjava :"
ls -l "$tempjava"
if [ -d "$tempjava" ] && [ "$(ls -A $tempjava/*.java)" ]; then
javac -parameters -cp "$temp/WEB-INF/lib/*" -d "$bin" "$tempjava"/*.java
else
echo "Aucun fichier Java à compiler dans $tempjava"
fi
if [ -d "$bin" ]; then
cp -r "$bin"/* "$temp/WEB-INF/classes"
else
echo "Aucun fichier compilé trouvé dans $bin"
fi
if [ -d "$conf" ]; then
cp -r "$conf"/* "$temp/WEB-INF/classes"
else
echo "Aucun fichier compilé trouvé dans $conf"
fi
cd "$temp" && jar -cvf "../$appName.war" *
echo "Déploiement terminé."