root / Portal / configurations / install.sh @ 3
History | View | Annotate | Download (3 kB)
1 | 3 | alavrent | #!/bin/bash |
---|---|---|---|
2 | 3 | alavrent | |
3 | 3 | alavrent | echo "** TXMWEB install: start." |
4 | 3 | alavrent | |
5 | 3 | alavrent | # auth params |
6 | 3 | alavrent | USER="$1" |
7 | 3 | alavrent | PASSWORD="$2" |
8 | 3 | alavrent | URL="$3" |
9 | 3 | alavrent | # parameters |
10 | 3 | alavrent | TOMCAT="$4" |
11 | 3 | alavrent | SRCFILES="$5" |
12 | 3 | alavrent | TXMWEBHOME="$6" |
13 | 3 | alavrent | # application |
14 | 3 | alavrent | WARPATH="$7" |
15 | 3 | alavrent | APPNAME="$8" |
16 | 3 | alavrent | |
17 | 3 | alavrent | MANAGERURL="http://$USER:$PASSWORD@$URL/manager/html/" |
18 | 3 | alavrent | |
19 | 3 | alavrent | # check params |
20 | 3 | alavrent | # Test $SRCFILES content |
21 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME" ]; then |
22 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME is missing" |
23 | 3 | alavrent | exit 1; |
24 | 3 | alavrent | fi |
25 | 3 | alavrent | |
26 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/biblio" ]; then |
27 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/biblio is missing. This folder contains the bibliographic records of texts" |
28 | 3 | alavrent | exit 1; |
29 | 3 | alavrent | fi |
30 | 3 | alavrent | |
31 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/css" ]; then |
32 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/css is missing. This folder contains the css files" |
33 | 3 | alavrent | exit 1; |
34 | 3 | alavrent | fi |
35 | 3 | alavrent | |
36 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/html" ]; then |
37 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/html is missing. This folder contains the HTML files" |
38 | 3 | alavrent | exit 1; |
39 | 3 | alavrent | fi |
40 | 3 | alavrent | |
41 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/images" ]; then |
42 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/images is missing. This folder contains the png, jpg, ... files" |
43 | 3 | alavrent | exit 1; |
44 | 3 | alavrent | fi |
45 | 3 | alavrent | |
46 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/jsp" ]; then |
47 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/jsp is missing. This folder contains the jsp files. Such as 404.jsp" |
48 | 3 | alavrent | exit 1; |
49 | 3 | alavrent | fi |
50 | 3 | alavrent | |
51 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/data" ]; then |
52 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/data is missing. This folder contains the data to launch TXMWEB itself." |
53 | 3 | alavrent | exit 1; |
54 | 3 | alavrent | fi |
55 | 3 | alavrent | |
56 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/data/users" ]; then |
57 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/data/users is missing. This folder contains the serialized users as XML files." |
58 | 3 | alavrent | exit 1; |
59 | 3 | alavrent | fi |
60 | 3 | alavrent | |
61 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/data/profiles" ]; then |
62 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/data/profiles is missing. This folder contains the serialized profiles as XML files." |
63 | 3 | alavrent | exit 1; |
64 | 3 | alavrent | fi |
65 | 3 | alavrent | |
66 | 3 | alavrent | if [ ! -d "$SRCFILES/$APPNAME/data/mails" ]; then |
67 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/data/mails is missing. This folder contains the mails templates." |
68 | 3 | alavrent | exit 1; |
69 | 3 | alavrent | fi |
70 | 3 | alavrent | |
71 | 3 | alavrent | # test conf files |
72 | 3 | alavrent | if [ ! -f "$SRCFILES/$APPNAME/txmweb.conf" ]; then |
73 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/txmweb.conf file is missing. It describes the parameters of TXMWEB" |
74 | 3 | alavrent | exit 1; |
75 | 3 | alavrent | fi |
76 | 3 | alavrent | |
77 | 3 | alavrent | if [ ! -f "$SRCFILES/$APPNAME/textometrie.properties" ]; then |
78 | 3 | alavrent | echo "** TXMWEB install: $SRCFILES/$APPNAME/textometrie.properties file is missing. It describes the parameters of the Toolbox" |
79 | 3 | alavrent | exit 1; |
80 | 3 | alavrent | fi |
81 | 3 | alavrent | |
82 | 3 | alavrent | # creating dirs |
83 | 3 | alavrent | # Try to create $TXMWEBHOME |
84 | 3 | alavrent | mkdir "$TXMWEBHOME" |
85 | 3 | alavrent | if [ ! -d "$TXMWEBHOME" ]; then |
86 | 3 | alavrent | echo "** TXMWEB install: src txmwebhome could not been created $TXMWEBHOME. Can't continue the installation." |
87 | 3 | alavrent | exit 1; |
88 | 3 | alavrent | fi |
89 | 3 | alavrent | |
90 | 3 | alavrent | # Try to create $TXMWEBHOME APP DIR |
91 | 3 | alavrent | mkdir "$TXMWEBHOME/$APPNAME" |
92 | 3 | alavrent | if [ ! -d "$TXMWEBHOME/$APPNAME" ]; then |
93 | 3 | alavrent | echo "** TXMWEB install: src txmwebhome could not been created $TXMWEBHOME/$APPNAME. Can't continue the installation." |
94 | 3 | alavrent | exit 1; |
95 | 3 | alavrent | fi |
96 | 3 | alavrent | |
97 | 3 | alavrent | # copy REPO files in home of $APPNAME |
98 | 3 | alavrent | cp -rf "$SRCFILES/$APPNAME" "$TXMWEBHOME" |
99 | 3 | alavrent | |
100 | 3 | alavrent | if [ $? != 0 ]; then |
101 | 3 | alavrent | echo "** TXMWEB install: Failed to copy files from repository $TXMWEBHOME/$APPNAME to TXMWEBHOME $TXMWEBHOME. Aborting." |
102 | 3 | alavrent | exit 1; |
103 | 3 | alavrent | fi |
104 | 3 | alavrent | |
105 | 3 | alavrent | # the end |
106 | 3 | alavrent | echo "** TXMWEB install: done." |