blob: 80c042f26fafceaad9f71eb1d60224e48c6edd6f [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() {
7 printf "\n\tUsage: %s [-h] | [-v] [-c] -s stream" $(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_williams72901652008-05-28 04:30:46 +000069 rsync -pua ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
70 rsync -pua ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
david_williams8015a282008-02-24 22:21:58 +000071
david_williams7ae2ec72008-07-11 02:32:54 +000072./createMirrorFile.sh -s "$stream" -b "$buildrepositorypath"
david_williams98aede32008-07-11 02:27:09 +000073
david_williams7ae2ec72008-07-11 02:32:54 +000074if [ "$?" -ne 0 ]
david_williams28659b22008-06-12 03:48:43 +000075then
76 exit $?
77fi
78
david_williams31500592009-05-19 22:40:37 +000079#./ant.sh -f ${fileListFile} -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams47f61222007-02-10 18:50:15 +000080
david_williams31500592009-05-19 22:40:37 +000081#if [ "$?" -ne 0 ]
82#then
83# exit $?
84#fi
david_williams4f1be032009-02-07 20:51:45 +000085
david_williams31500592009-05-19 22:40:37 +000086#echo
87#echo " merge authored site.xml files with the most recent auto generated one"
88#echo " mainSiteFileName: " ${mainSiteFileName}
89#echo " testUpdateSite: " ${testUpdateSite}
90#./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${testUpdateSite}
david_williams47f61222007-02-10 18:50:15 +000091
david_williams31500592009-05-19 22:40:37 +000092#if [ "$?" -ne 0 ]
93#then
94# exit $?
95#fi
david_williams4f1be032009-02-07 20:51:45 +000096
david_williams843da282007-05-26 20:58:37 +000097# do create pack's later ... takes a long time
david_williamsdb911a72008-06-11 15:34:10 +000098# ./ant.sh -f createPack200s.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williamsd6fa29c2009-02-07 22:08:51 +000099#if [ "$?" -ne 0 ]
100#then
101# exit $?
102#fi
david_williams4f1be032009-02-07 20:51:45 +0000103
david_williams843da282007-05-26 20:58:37 +0000104# run create Digests now, it's a good check if all is well
david_williams31500592009-05-19 22:40:37 +0000105#./ant.sh -f createDigests.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams60d00142008-05-28 02:32:50 +0000106
david_williams31500592009-05-19 22:40:37 +0000107#if [ "$?" -ne 0 ]
108#then
109# exit $?
110#fi
david_williams4f1be032009-02-07 20:51:45 +0000111
david_williams60d00142008-05-28 02:32:50 +0000112# create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +0000113./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams4f1be032009-02-07 20:51:45 +0000114
115if [ "$?" -ne 0 ]
116then
117 exit $?
118fi