Separate dumps by state: enable/disable Success and Failed tests
[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/ADML-client
59     $DEPLOY_SCR b $DIR/ADML-server
60     echo "Configuring ..."
61     cd $DIR/ADML-client
62     echo c | ./configure.sh >/dev/null
63     cd - >/dev/null
64     cd $DIR/ADML-server
65     echo s | ./configure.sh >/dev/null
66     cd - >/dev/null
67   ;;
68
69   2)
70     $DEPLOY_SCR f $DIR/ADML-ft-client
71     $DEPLOY_SCR b $DIR/ADML-server
72     echo "Configuring ..."
73     cd $DIR/ADML-server
74     echo s | ./configure.sh >/dev/null
75     cd - >/dev/null
76   ;;
77
78   3)
79     $DEPLOY_SCR s $DIR/ADML-st-client
80     $DEPLOY_SCR b $DIR/ADML-serverGx
81     $DEPLOY_SCR b $DIR/ADML-serverRx
82     echo "Configuring ..."
83     cd $DIR/ADML-st-client
84     ln -s realms_example realms
85     mv run.sh .run-one.sh
86     mv run_all.sh run.sh
87     mv operation.sh .operation-one.sh
88     mv operation_all.sh operation.sh
89     rm dictionary.xml
90     cd - >/dev/null
91     cd $DIR/ADML-serverGx
92     echo s | ./configure.sh >/dev/null
93     sed -i 's/3868/3869/' services.xml
94     ln -sf stacks/other_examples/16777238.xml dictionary.xml
95     cd - >/dev/null
96     cd $DIR/ADML-serverRx
97     echo s | ./configure.sh >/dev/null
98     ln -sf stacks/other_examples/16777236.xml dictionary.xml
99     cd - >/dev/null
100   ;;
101 esac
102
103 echo
104 echo "Done!"
105 echo
106