Changeset 1373
- Timestamp:
- 12/19/08 16:45:32 (4 years ago)
- Files:
-
- 1 modified
-
trunk/MapFish/deploy/deploy.sh (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/MapFish/deploy/deploy.sh
r1034 r1373 87 87 rm -rf $PROJECT 88 88 fi 89 fetch_project 89 fetch_project $1 90 90 91 91 run_hook post_init_light … … 96 96 97 97 create_python_env 98 init_light 98 init_light $1 99 99 100 100 run_hook post_init_all … … 203 203 fetch_project() { 204 204 run_hook pre_fetch_project 205 205 206 206 echo "Fetching/updating project" 207 207 if [ -d "project_source/$PROJECT" ]; then … … 209 209 rsync -av project_source/$PROJECT . 210 210 else 211 $SVN co $SVN_CO_OPTIONS ${PROJECT_SVN_BASE} 211 (echo "${PROJECT_SVN_BASE}" | egrep "(trunk|branches|tags)\/${PROJECT}\/*") 212 if [ $? -eq 0 ]; then 213 project_svn="${PROJECT_SVN_BASE}" 214 else 215 if [ -n $1 ]; then 216 project_svn="${PROJECT_SVN_BASE}/${1}/${PROJECT}" 217 else 218 project_svn="${PROJECT_SVN_BASE}/trunk/${PROJECT}" 219 fi 220 fi 221 $SVN co $SVN_CO_OPTIONS ${project_svn} 212 222 fi 213 223 init_mapfish … … 224 234 } 225 235 236 create_branch() { 237 $SVN mkdir -m "create dir for branch $1" ${PROJECT_SVN_BASE}/branches/$1/ 238 $SVN cp -m "create branch $1" ${PROJECT_SVN_BASE}/trunk/$PROJECT ${PROJECT_SVN_BASE}/branches/$1 239 if [ "$HAS_MAPFISH" = "1" ]; then 240 # 241 # The branch includes a copy (snapshot) of MapFish as opposed 242 # to an svn:externals to MapFish trunk 243 # 244 ( 245 cd /tmp 246 rm -rf $PROJECT 247 echo "fetching project, it may time some time..." 248 $SVN co ${PROJECT_SVN_BASE}/branches/$1/$PROJECT 249 cd $PROJECT 250 $SVN export MapFish MapFish_ 251 $SVN propdel svn:externals MapFish . 252 $SVN commit -m "remove externals to MapFish" . 253 rm -rf MapFish 254 mv MapFish_ MapFish 255 $SVN add MapFish 256 $SVN commit -m "add MapFish" MapFish 257 ) 258 fi 259 } 260 261 create_tag() { 262 echo "Enter branch name, followed by [ENTER]" 263 read branch 264 $SVN mkdir -m "create dir for tag $1" ${PROJECT_SVN_BASE}/tags/$1/ 265 $SVN cp -m "create tag $1" ${PROJECT_SVN_BASE}/branches/$branch/$PROJECT ${PROJECT_SVN_BASE}/tags/$1 266 } 267 268 226 269 # 227 270 # Main function … … 236 279 fi 237 280 238 while getopts ijurh OPT; do 281 opt_i="no" 282 opt_j="no" 283 opt_u="no" 284 opt_b="no" 285 opt_t="no" 286 287 while getopts ijurhb:t: OPT; do 239 288 case $OPT in 240 289 i) 241 echo "Initializing everything" 242 init_all 290 opt_i="yes" 243 291 ;; 244 292 j) 245 echo "Initializing MapFish and project" 246 init_light 293 opt_j="yes" 247 294 ;; 248 295 u) 249 echo "Updating project" 250 fetch_project 296 opt_u="yes" 251 297 ;; 252 298 r) … … 254 300 subst_in_files 255 301 ;; 302 b) 303 opt_b="$OPTARG" 304 ;; 305 t) 306 opt_t="$OPTARG" 307 ;; 256 308 \?|h) 257 309 echo "Usage: $0 OPTION" 258 310 echo " -h: help" 259 echo -n " -i: initialize everything " 260 echo "(WARNING: this deletes existing directories)" 261 echo -n " -j: initialize MapFish and project " 262 echo "(WARNING: this deletes existing project and MapFish)" 311 echo " -i: initialize everything " 312 echo " WARNING: this deletes existing directories" 313 echo " can be used with -t or -b to retrieve a specific tag or branch" 314 echo " -j: initialize MapFish and project " 315 echo " (WARNING: this deletes existing project and MapFish)" 316 echo " can be used with -t or -b to retrieve a specific tag or branch" 263 317 echo " -u: update project" 318 echo " can be used with -t or -b to retrieve a specific tag or branch" 264 319 echo " -r: replace .in files" 320 echo " -b <branch_name>: if not used with -i or -j or -u create a new branch," 321 echo " replacing the svn:external to MapFish by a copy of MapFish" 322 echo " -t <tag_name>: if not used with -i or -j or -u create a new tag" 323 echo 265 324 exit 1 266 325 ;; 267 326 esac 268 327 done 328 329 arg= 330 if [ $opt_b != "no" ]; then 331 arg="branches/$opt_b" 332 fi 333 if [ $opt_t != "no" ]; then 334 arg="tags/$opt_t" 335 fi 336 337 if [ $opt_i = "yes" ]; then 338 echo "Initializing everything" 339 init_all $arg 340 elif [ $opt_j = "yes" ]; then 341 echo "Initializing MapFish and project" 342 init_light $arg 343 elif [ $opt_u = "yes" ]; then 344 echo "Updating project" 345 fetch_project $arg 346 elif [ $opt_t != "no" ]; then 347 echo "Create tag from branch" 348 create_tag $opt_t 349 elif [ $opt_b != "no" ]; then 350 echo "Create branch from trunk (with a snapshot of MapFish)" 351 create_branch $opt_b 352 fi 353 269 354 echo "Done." 270 355 }
