blob: 41288e212b27295b7c5cf3aa66a940461289fc58 [file] [log] [blame]
david_williams47f61222007-02-10 18:50:15 +00001#!/bin/sh
2
3# script to run update, setting properties, for all projects
4
david_williamsed5201c2007-05-27 05:48:38 +00005
david_williamsdb9a9592008-06-13 05:32:49 +00006function usage() {
david_williams889b15f2009-06-03 01:26:54 +00007 printf "\n\tUsage: %s [-h] | [-v] [-c] -s stream -b buildrepositorypath" $(basename $0) >&2
david_williamsd4c67152008-06-13 05:42:23 +00008 printf "\n\t\t%s\n\n" "where h==help, v==verbose, c==clean and s==stream, where steam is Ganymede, Europa, etc" >&2
david_williamsdb9a9592008-06-13 05:32:49 +00009}
10
david_williamsd4c67152008-06-13 05:42:23 +000011
david_williamsdb9a9592008-06-13 05:32:49 +000012clean=
13stream=
david_williams649ad682008-06-13 05:47:57 +000014verbose=
david_williamsf4ea4b12008-06-13 05:53:29 +000015while getopts 'hvcs:b:' OPTION
david_williamsdb9a9592008-06-13 05:32:49 +000016do
17 case $OPTION in
18 h) usage
19 exit 1
20 ;;
david_williamsf4ea4b12008-06-13 05:53:29 +000021 c) export clean=1
david_williamsdb9a9592008-06-13 05:32:49 +000022 ;;
david_williamsf4ea4b12008-06-13 05:53:29 +000023 v) export verbose=1
david_williams649ad682008-06-13 05:47:57 +000024 ;;
25 s) stream=$OPTARG
david_williamsf4ea4b12008-06-13 05:53:29 +000026 ;;
david_williams3f1d45a2008-06-13 06:26:17 +000027 b) export buildrepositorypath=$OPTARG
david_williamsf4ea4b12008-06-13 05:53:29 +000028 ;;
david_williamsdb9a9592008-06-13 05:32:49 +000029 ?) usage
30 exit 2
31 ;;
32 esac
33done
34
35shift $(($OPTIND - 1))
36
david_williamsd4c67152008-06-13 05:42:23 +000037if [ -z $stream ]
david_williamsb9598612008-06-13 05:45:11 +000038then
david_williamsd4c67152008-06-13 05:42:23 +000039 echo ""
40 echo " Need a stream argument"
41 usage
42 exit 1
43fi
44
david_williams98aede32008-07-11 02:27:09 +000045echo " Stream: " $stream
46
david_williamsdb9a9592008-06-13 05:32:49 +000047if [ -z $BUILD_INITIALIZED ]
48then
49 source properties.shsource
50 source parseSiteArg.shsource $stream
51 export BUILD_INITIALIZED=1
52fi
53
54
55if [ $clean ] ; then
david_williams47f61222007-02-10 18:50:15 +000056
david_williams72901652008-05-28 04:30:46 +000057 echo " Removing ${testUpdateSite}/features/"
58 rm -fr ${testUpdateSite}/features/
david_williams47f61222007-02-10 18:50:15 +000059
david_williams72901652008-05-28 04:30:46 +000060 echo " Removing ${testUpdateSite}/plugins/"
61 rm -fr ${testUpdateSite}/plugins/
david_williams47f61222007-02-10 18:50:15 +000062
63 echo " Removing index and site xml files"
david_williams72901652008-05-28 04:30:46 +000064 rm -fr ${testUpdateSite}/*
david_williams8015a282008-02-24 22:21:58 +000065
david_williams843da282007-05-26 20:58:37 +000066fi
david_williams8015a282008-02-24 22:21:58 +000067
68 echo " Updating index and web site files, but not site xml files (yet)"
david_williamsa7ef7c82009-06-03 01:19:13 +000069 rsync -pua "${buildrepositorypath}" "${testUpdateSite}"
david_williams72901652008-05-28 04:30:46 +000070 rsync -pua ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
david_williams889b15f2009-06-03 01:26:54 +000071 rsync -rpua ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
david_williams8015a282008-02-24 22:21:58 +000072
david_williams7ae2ec72008-07-11 02:32:54 +000073./createMirrorFile.sh -s "$stream" -b "$buildrepositorypath"
david_williams98aede32008-07-11 02:27:09 +000074
david_williams7ae2ec72008-07-11 02:32:54 +000075if [ "$?" -ne 0 ]
david_williams28659b22008-06-12 03:48:43 +000076then
77 exit $?
78fi
79
david_williams31500592009-05-19 22:40:37 +000080#./ant.sh -f ${fileListFile} -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams47f61222007-02-10 18:50:15 +000081
david_williams31500592009-05-19 22:40:37 +000082#if [ "$?" -ne 0 ]
83#then
84# exit $?
85#fi
david_williams4f1be032009-02-07 20:51:45 +000086
david_williams31500592009-05-19 22:40:37 +000087#echo
88#echo " merge authored site.xml files with the most recent auto generated one"
89#echo " mainSiteFileName: " ${mainSiteFileName}
90#echo " testUpdateSite: " ${testUpdateSite}
91#./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${testUpdateSite}
david_williams47f61222007-02-10 18:50:15 +000092
david_williams31500592009-05-19 22:40:37 +000093#if [ "$?" -ne 0 ]
94#then
95# exit $?
96#fi
david_williams4f1be032009-02-07 20:51:45 +000097
david_williams843da282007-05-26 20:58:37 +000098# do create pack's later ... takes a long time
david_williamsdb911a72008-06-11 15:34:10 +000099# ./ant.sh -f createPack200s.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williamsd6fa29c2009-02-07 22:08:51 +0000100#if [ "$?" -ne 0 ]
101#then
102# exit $?
103#fi
david_williams4f1be032009-02-07 20:51:45 +0000104
david_williams843da282007-05-26 20:58:37 +0000105# run create Digests now, it's a good check if all is well
david_williams31500592009-05-19 22:40:37 +0000106#./ant.sh -f createDigests.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams60d00142008-05-28 02:32:50 +0000107
david_williams31500592009-05-19 22:40:37 +0000108#if [ "$?" -ne 0 ]
109#then
110# exit $?
111#fi
david_williams4f1be032009-02-07 20:51:45 +0000112
david_williams60d00142008-05-28 02:32:50 +0000113# create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +0000114./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams4f1be032009-02-07 20:51:45 +0000115
116if [ "$?" -ne 0 ]
117then
118 exit $?
119fi