System test refinement
[anna.git] / example / diameter / launcher / DEPLOY_setups.sh
1 #!/bin/sh
2
3 #############
4 # VARIABLES #
5 #############
6 DEPLOY_SCR=`dirname $0`/DEPLOY.sh
7
8 #############
9 # FUNCTIONS #
10 #############
11 _exit() {
12   echo
13   echo $1
14   echo
15   exit 1
16 }
17
18 #############
19 # EXECUTION #
20 #############
21 echo
22 echo "Which one you want to deploy [1]:"
23 echo
24 echo "   1. Client and server"
25 echo "   2. Ft-client and server"
26 echo "   3. St-client and servers"
27 echo
28 read type
29 [ "$type" = "" ] && type=1
30
31 case $type in
32   1)
33     DEPLOY_DIR__dflt=$HOME/ADML-clientAndServer
34   ;;
35
36   2)
37     DEPLOY_DIR__dflt=$HOME/ADML-ftclientAndServer
38   ;;
39
40   3)
41     DEPLOY_DIR__dflt=$HOME/ADML-stclientAndServers
42   ;;
43
44   *)
45     echo "Unknown option!"
46     exit 1
47   ;;
48 esac
49
50 echo
51 echo "Directory for deploy [$DEPLOY_DIR__dflt]:"
52 read DIR
53 [ "$DIR" = "" ] && DIR=$DEPLOY_DIR__dflt
54 [ -d $DIR ] && _exit "The directory '$DIR' already exists !"
55
56 case $type in
57   1)
58     $DEPLOY_SCR b $DIR/client
59     $DEPLOY_SCR b $DIR/server
60     echo "Configuring ..."
61     cd $DIR/client
62     echo c | ./configure.sh >/dev/null
63     cd - >/dev/null
64     cd $DIR/server
65     echo s | ./configure.sh >/dev/null
66     cd - >/dev/null
67   ;;
68
69   2)
70     $DEPLOY_SCR f $DIR/ft-client
71     $DEPLOY_SCR b $DIR/server
72     echo "Configuring ..."
73     cd $DIR/server
74     echo s | ./configure.sh >/dev/null
75     cd - >/dev/null
76   ;;
77
78   3)
79     $DEPLOY_SCR s $DIR/st-client
80     $DEPLOY_SCR b $DIR/serverGx
81     $DEPLOY_SCR b $DIR/serverRx
82     echo "Configuring ..."
83     cd $DIR/st-client
84     mv run.sh .run-one.sh
85     mv run_all.sh run.sh
86     mv operation.sh .operation-one.sh
87     mv operation_all.sh operation.sh
88     rm dictionary.xml
89     cd - >/dev/null
90     cd $DIR/serverGx
91     echo s | ./configure.sh >/dev/null
92     sed -i 's/3868/3869/' services.xml
93     ln -sf stacks/other_examples/16777238.xml dictionary.xml
94     cd - >/dev/null
95     cd $DIR/serverRx
96     echo s | ./configure.sh >/dev/null
97     ln -sf stacks/other_examples/16777236.xml dictionary.xml
98     cd - >/dev/null
99   ;;
100 esac
101
102 echo
103 echo "Done!"
104 echo
105