Blame view

update_amda/updateAmda 3.93 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

	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
8e37c3fd   Myriam Bouchemit   Fix for synchro
45
	fi	
4c77b9b1   Elena.Budnik   final update
46
47
48
49
50
	
	if [ $CLEAN_NEWMETA ]
		then 
			echo "cleaning in NEWMETA.."
			# cleanNewMetaLight
9ad25dca   Elena.Budnik   relative path
51
52
			$UPDATEDIR/cleanNewMetaLight
			$UPDATEDIR/cleanNewMetaParamInfo
4c77b9b1   Elena.Budnik   final update
53
54
55
56
57
58
59
60
61
			echo "clean in NEWMETA : done"
			exit
	fi
		
	if [ $INSTALL ] 
		then
			echo "Installing...."
			
			echo "cleaning in NEWMETA.."
9ad25dca   Elena.Budnik   relative path
62
			$UPDATEDIR/cleanNewMetaLight
4c77b9b1   Elena.Budnik   final update
63
64
			echo "clean in NEWMETA : done"
			
4c77b9b1   Elena.Budnik   final update
65
66
67
68
69
70
71
72
73
74
			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
75
			php $UPDATEDIR/makeTree.php
4c77b9b1   Elena.Budnik   final update
76
77
			echo "make Tree : done"
			
9e65752e   Elena.Budnik   updateAmda : clea...
78
79
80
81
			echo "cleaning in AMDA_IHM/generic_data ..."
			$UPDATEDIR/cleanExistingInstallation 
			echo "clean in AMDA_IHM/generic_data : done"
			
4c77b9b1   Elena.Budnik   final update
82
			echo "copying 2 amda..."
9ad25dca   Elena.Budnik   relative path
83
			$UPDATEDIR/cp2amda
4c77b9b1   Elena.Budnik   final update
84
			echo "copy 2 amda : done"	
fa544567   Benjamin Renard   First implementat...
85

4c77b9b1   Elena.Budnik   final update
86
			echo "making Orbits..."
9ad25dca   Elena.Budnik   relative path
87
			$UPDATEDIR/makeOrbits
4c77b9b1   Elena.Budnik   final update
88
			echo "make Orbits : done"
d73734df   Elena.Budnik   add DDBASE Remote...
89
90
			
			echo "copy DDBASE Remote Params descriptions"
99ae8744   Benjamin Renard   Use config variab...
91
92
			if [ -d $RemoteData/PARAMS ]; then
				cp $RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/
d73734df   Elena.Budnik   add DDBASE Remote...
93
			fi 
1577b1e7   Benjamin Renard   Fix for HAPI serv...
94
95
96
97

			echo "making HAPI metadata..."
			php $UPDATEDIR/makeHAPIMetadata.php
			echo "make HAPI metadata : done"
4c77b9b1   Elena.Budnik   final update
98
	fi
f54abb40   Elena.Budnik   update Help
99
		# Update StartStop & Help only	
4c77b9b1   Elena.Budnik   final update
100
101
102
103
104
105
106
107
108
109
110
111
	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
112
113
114
115
116
			echo 'update in NEWMETA/help: done'
			
			cp $NEWMETA/help/*  $HelpAuto
			
			echo "copy  $NEWMETA/help/ to $HelpAuto : done" 
4c77b9b1   Elena.Budnik   final update
117
118
			
			echo "making Tree..."
9ad25dca   Elena.Budnik   relative path
119
			php $UPDATEDIR/makeTree.php
4c77b9b1   Elena.Budnik   final update
120
121
			echo "make Tree : done"
 
99ae8744   Benjamin Renard   Use config variab...
122
			if [ -d $LocalData ] && [ -e ./LocalParams.xml ]
4c77b9b1   Elena.Budnik   final update
123
			then
99ae8744   Benjamin Renard   Use config variab...
124
				mv ./LocalParams.xml $LocalData
4c77b9b1   Elena.Budnik   final update
125
126
			fi
			echo 'copy 2 amda : done'
fa544567   Benjamin Renard   First implementat...
127

4c77b9b1   Elena.Budnik   final update
128
			echo "updating OrbitsInfo..."
99ae8744   Benjamin Renard   Use config variab...
129
			php $AMDA_IHM/php/RemoteDataCenter/makeOrbitsInfo.php
4c77b9b1   Elena.Budnik   final update
130
			echo "update OrbitsInfo : done" 
1577b1e7   Benjamin Renard   Fix for HAPI serv...
131
132
133
134

			echo "making HAPI metadata..."
			php $UPDATEDIR/makeHAPIMetadata.php
			echo "make HAPI metadata : done"
4c77b9b1   Elena.Budnik   final update
135
136
137
138
139
140
141
	fi
	
	if [ $PARAM_INFO ] 
		then
			echo "Generating param info...."
			
			if [ $CLEAN_ARGS ]; then 
9ad25dca   Elena.Budnik   relative path
142
				$UPDATEDIR/cleanNewMetaParamInfo
4c77b9b1   Elena.Budnik   final update
143
144
145
146
			fi
			
			generate_param_info
			# copy info for parameter arguments
99ae8744   Benjamin Renard   Use config variab...
147
148
			if [ ! -d $PARAMS_LOCALINFO_DIR ]; then
				mkdir $PARAMS_LOCALINFO_DIR
4c77b9b1   Elena.Budnik   final update
149
150
151
152
			fi 
			
			if [ -d $NEWMETA/ParamInfo ] 
			then 
99ae8744   Benjamin Renard   Use config variab...
153
				cp $NEWMETA/ParamInfo/info*.xml $PARAMS_LOCALINFO_DIR
4c77b9b1   Elena.Budnik   final update
154
155
156
157
158
159
160
161
			fi 
			
			echo "generate info for arguments : done"								
	fi
		 	
	if [ $REMOTE ] 
		then
			echo "making Remote"
9ad25dca   Elena.Budnik   relative path
162
			$UPDATEDIR/makeRemote
4c77b9b1   Elena.Budnik   final update
163
164
			echo "make Remote : done"
	fi
2d0ca0ba   Benjamin Renard   Load environment ...
165