blob: f19f32fea6c916045aa7a9e80f8bdd41261ec8d9 [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_williamsdb9a9592008-06-13 05:32:49 +000045if [ -z $BUILD_INITIALIZED ]
46then
47 source properties.shsource
48 source parseSiteArg.shsource $stream
49 export BUILD_INITIALIZED=1
50fi
51
52
53if [ $clean ] ; then
david_williams47f61222007-02-10 18:50:15 +000054
david_williams72901652008-05-28 04:30:46 +000055 echo " Removing ${testUpdateSite}/features/"
56 rm -fr ${testUpdateSite}/features/
david_williams47f61222007-02-10 18:50:15 +000057
david_williams72901652008-05-28 04:30:46 +000058 echo " Removing ${testUpdateSite}/plugins/"
59 rm -fr ${testUpdateSite}/plugins/
david_williams47f61222007-02-10 18:50:15 +000060
61 echo " Removing index and site xml files"
david_williams72901652008-05-28 04:30:46 +000062 rm -fr ${testUpdateSite}/*
david_williams8015a282008-02-24 22:21:58 +000063
david_williams843da282007-05-26 20:58:37 +000064fi
david_williams8015a282008-02-24 22:21:58 +000065
66 echo " Updating index and web site files, but not site xml files (yet)"
david_williams72901652008-05-28 04:30:46 +000067 rsync -pua ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
68 rsync -pua ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
david_williams8015a282008-02-24 22:21:58 +000069
david_williamsdb9a9592008-06-13 05:32:49 +000070./createMirrorFile.sh "$@"
david_williams77285892008-06-12 03:25:57 +000071
david_williams28659b22008-06-12 03:48:43 +000072if [ "$?" -ne "0" ]
73then
74 exit $?
75fi
76
david_williamsdb911a72008-06-11 15:34:10 +000077./ant.sh -f ${fileListFile} -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams47f61222007-02-10 18:50:15 +000078
david_williams1672c662008-05-28 06:06:53 +000079echo
80echo " merge authored site.xml files with the most recent auto generated one"
david_williams406ce422008-06-12 04:22:39 +000081echo " mainSiteFileName: " ${mainSiteFileName}
82echo " testUpdateSite: " ${testUpdateSite}
david_williamsefd0ee62008-05-28 06:17:53 +000083./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${testUpdateSite}
david_williams1672c662008-05-28 06:06:53 +000084echo
david_williams47f61222007-02-10 18:50:15 +000085
david_williams843da282007-05-26 20:58:37 +000086# do create pack's later ... takes a long time
david_williamsdb911a72008-06-11 15:34:10 +000087# ./ant.sh -f createPack200s.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams33b8c382007-05-25 05:41:33 +000088
david_williams843da282007-05-26 20:58:37 +000089# run create Digests now, it's a good check if all is well
david_williamsdb911a72008-06-11 15:34:10 +000090./ant.sh -f createDigests.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams60d00142008-05-28 02:32:50 +000091
92# create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +000093./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}