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