Blame view

update_amda/updateAmda 3.96 KB
4c77b9b1   Elena.Budnik   final update
1
2
3
4
#!/bin/bash

# --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ;
# --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;
2d0ca0ba   Benjamin Renard   Load environment ...
5
6
7

	SCRIPT=$(readlink -f "$0")
	export UPDATEDIR=$(dirname "$SCRIPT")
9ad25dca   Elena.Budnik   relative path
8
	. $UPDATEDIR/updateEnv.sh
4c77b9b1   Elena.Budnik   final update
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

	for option in $@
	do
		case $option in
			--install | -i)  INSTALL=1
			;;
			--update-internal | -u)  UPDATE=1
			;;
			--with-remote | -r)  REMOTE=1 
			;;
			--generate-param-args | -a) PARAM_INFO=1
												 CLEAN_ARGS=1
			;;
			--update-param-args | -p) PARAM_INFO=1											  
			;;
			--spase-synchro | -s) SYNCHRO=1
			;;
			--clean-new-meta | -c) CLEAN_NEWMETA=1
			;;
			--help | -h) echo "updateAmda --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ; --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;"							
							 exit
			;;
			*) echo "Invalid option" $option
				exit
			;;
		esac
	done
		
	#Please export DDUSER and DDPASS in the shell !!!!
	if  [ $PARAM_INFO ] && [[ -z ${DDUSER+x}  || -z ${DDPASS+x} ]]
		then 
			echo "Warning : DDUSER and DDPASS should be defined to generate params info"
			echo "No params info generation will be done!!!" 
			unset PARAM_INFO
			#export DDUSER=XXXX
			#export DDPASS=XXXX
	fi
	
	# In the case of SPASE synchro export SPASEUSER
	if [ -z ${SPASEUSER+x} ] && [ $SYNCHRO ]
		then
			echo "SPASEUSER should be defined to SYNCHRO SPASE Registry"
			echo "No SYNHRO wil be done!!!" 
			#export SPASEUSER=XXXX
			unset SYNCHRO 
	fi 
	
	if [ $CLEAN_NEWMETA ]
		then 
			echo "cleaning in NEWMETA.."
			# cleanNewMetaLight
9ad25dca   Elena.Budnik   relative path
60
61
			$UPDATEDIR/cleanNewMetaLight
			$UPDATEDIR/cleanNewMetaParamInfo
4c77b9b1   Elena.Budnik   final update
62
63
64
65
66
67
68
69
70
			echo "clean in NEWMETA : done"
			exit
	fi
		
	if [ $INSTALL ] 
		then
			echo "Installing...."
			
			echo "cleaning in NEWMETA.."
9ad25dca   Elena.Budnik   relative path
71
			$UPDATEDIR/cleanNewMetaLight
4c77b9b1   Elena.Budnik   final update
72
73
			echo "clean in NEWMETA : done"
			
4c77b9b1   Elena.Budnik   final update
74
75
76
77
78
79
80
81
82
83
			echo "making Amda From Spase..."
			if [ $SYNCHRO ]
				then 
					php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php "synchro"
				else 
					php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php
			fi			
			echo "make Amda From Spase : done"
			
			echo "making Tree..."
9ad25dca   Elena.Budnik   relative path
84
			php $UPDATEDIR/makeTree.php
4c77b9b1   Elena.Budnik   final update
85
86
			echo "make Tree : done"
			
9e65752e   Elena.Budnik   updateAmda : clea...
87
88
89
90
			echo "cleaning in AMDA_IHM/generic_data ..."
			$UPDATEDIR/cleanExistingInstallation 
			echo "clean in AMDA_IHM/generic_data : done"
			
4c77b9b1   Elena.Budnik   final update
91
			echo "copying 2 amda..."
9ad25dca   Elena.Budnik   relative path
92
			$UPDATEDIR/cp2amda
4c77b9b1   Elena.Budnik   final update
93
94
95
			echo "copy 2 amda : done"	
			
			echo "making Orbits..."
9ad25dca   Elena.Budnik   relative path
96
			$UPDATEDIR/makeOrbits
4c77b9b1   Elena.Budnik   final update
97
			echo "make Orbits : done"
d73734df   Elena.Budnik   add DDBASE Remote...
98
99
			
			echo "copy DDBASE Remote Params descriptions"
99ae8744   Benjamin Renard   Use config variab...
100
101
			if [ -d $RemoteData/PARAMS ]; then
				cp $RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/
d73734df   Elena.Budnik   add DDBASE Remote...
102
			fi 
4c77b9b1   Elena.Budnik   final update
103
	fi
f54abb40   Elena.Budnik   update Help
104
		# Update StartStop & Help only	
4c77b9b1   Elena.Budnik   final update
105
106
107
108
109
110
111
112
113
114
115
116
	if [ $UPDATE ]
		then
			echo "Updating...."
			
			if [ $SYNCHRO ]
				then 
					php $AMDA_SPASE_INTERFACE/updateStartStop.php 'synchro'
				else 
					php $AMDA_SPASE_INTERFACE/updateStartStop.php	 
			fi
			
			echo 'update in NEWMETA/dd_missions: done'
f54abb40   Elena.Budnik   update Help
117
118
119
120
121
			echo 'update in NEWMETA/help: done'
			
			cp $NEWMETA/help/*  $HelpAuto
			
			echo "copy  $NEWMETA/help/ to $HelpAuto : done" 
4c77b9b1   Elena.Budnik   final update
122
123
			
			echo "making Tree..."
9ad25dca   Elena.Budnik   relative path
124
			php $UPDATEDIR/makeTree.php
4c77b9b1   Elena.Budnik   final update
125
126
			echo "make Tree : done"
 
99ae8744   Benjamin Renard   Use config variab...
127
			if [ -d $LocalData ] && [ -e ./LocalParams.xml ]
4c77b9b1   Elena.Budnik   final update
128
			then
99ae8744   Benjamin Renard   Use config variab...
129
				mv ./LocalParams.xml $LocalData
4c77b9b1   Elena.Budnik   final update
130
131
132
133
			fi
			echo 'copy 2 amda : done'
			
			echo "updating OrbitsInfo..."
99ae8744   Benjamin Renard   Use config variab...
134
			php $AMDA_IHM/php/RemoteDataCenter/makeOrbitsInfo.php
4c77b9b1   Elena.Budnik   final update
135
136
137
138
139
140
141
142
			echo "update OrbitsInfo : done" 
	fi
	
	if [ $PARAM_INFO ] 
		then
			echo "Generating param info...."
			
			if [ $CLEAN_ARGS ]; then 
9ad25dca   Elena.Budnik   relative path
143
				$UPDATEDIR/cleanNewMetaParamInfo
4c77b9b1   Elena.Budnik   final update
144
145
146
147
			fi
			
			generate_param_info
			# copy info for parameter arguments
99ae8744   Benjamin Renard   Use config variab...
148
149
			if [ ! -d $PARAMS_LOCALINFO_DIR ]; then
				mkdir $PARAMS_LOCALINFO_DIR
4c77b9b1   Elena.Budnik   final update
150
151
152
153
			fi 
			
			if [ -d $NEWMETA/ParamInfo ] 
			then 
99ae8744   Benjamin Renard   Use config variab...
154
				cp $NEWMETA/ParamInfo/info*.xml $PARAMS_LOCALINFO_DIR
4c77b9b1   Elena.Budnik   final update
155
156
157
158
159
160
161
162
			fi 
			
			echo "generate info for arguments : done"								
	fi
		 	
	if [ $REMOTE ] 
		then
			echo "making Remote"
9ad25dca   Elena.Budnik   relative path
163
			$UPDATEDIR/makeRemote
4c77b9b1   Elena.Budnik   final update
164
165
			echo "make Remote : done"
	fi
2d0ca0ba   Benjamin Renard   Load environment ...
166