blob: fe83102f81a40e15c85043e726b1b84c5933fa18 [file] [log] [blame]
david_williams9d0e8352009-05-28 23:44:15 +00001#!/bin/sh
2
3# script to run update, setting properties, for all projects
4
5
6function usage() {
7 printf "\n\tUsage: %s [-h] | [-v] [-c] -b repoPath" $(basename $0) >&2
8 printf "\n\t\t%s\n\n" "where h==help, v==verbose, c==clean and s==stream, where steam is Ganymede, Europa, etc" >&2
9}
10
11
12clean=
13stream=Ganymede
14verbose=
15while getopts 'hvcb:' OPTION
16do
17 case $OPTION in
18 h) usage
19 exit 1
20 ;;
21 c) export clean=1
22 ;;
23 v) export verbose=1
24 ;;
25 b) export buildrepositorypath=$OPTARG
26 ;;
27 ?) usage
28 exit 2
29 ;;
30 esac
31done
32
33shift $(($OPTIND - 1))
34
35if [ -z $stream ]
36then
37 echo ""
38 echo " Need a stream argument"
39 usage
40 exit 1
41fi
42
43echo " Stream: " $stream
44
45if [ -z $BUILD_INITIALIZED ]
46then
47 source properties.shsource
48 source parseSiteArg.shsource $stream
49 export BUILD_INITIALIZED=1
50fi
51
52
53if [ $clean ] ; then
54
55 echo " Removing ${testUpdateSite}/features/"
56 rm -fr ${testUpdateSite}/features/
57
58 echo " Removing ${testUpdateSite}/plugins/"
59 rm -fr ${testUpdateSite}/plugins/
60
61 echo " Removing index and site xml files"
62 rm -fr ${testUpdateSite}/*
63
64fi
65
66 echo " Updating index and web site files, but not site xml files (yet)"
67 rsync -pua ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
68 rsync -pua ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
69
70./createMirrorFile.sh -s "$stream" -b "$buildrepositorypath"
71
72if [ "$?" -ne 0 ]
73then
74 exit $?
75fi
76
77./ant.sh -f ${fileListFile} -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
78
79if [ "$?" -ne 0 ]
80then
81 exit $?
82fi
83
84echo
85echo " merge authored site.xml files with the most recent auto generated one"
86echo " mainSiteFileName: " ${mainSiteFileName}
87echo " testUpdateSite: " ${testUpdateSite}
88./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${testUpdateSite}
89
90if [ "$?" -ne 0 ]
91then
92 exit $?
93fi
94
95# do create pack's later ... takes a long time
96# ./ant.sh -f createPack200s.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
97#if [ "$?" -ne 0 ]
98#then
99# exit $?
100#fi
101
102# run create Digests now, it's a good check if all is well
103./ant.sh -f createDigests.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
104
105if [ "$?" -ne 0 ]
106then
107 exit $?
108fi
109
110
111# create P2 repository metadata
112./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
113
114if [ "$?" -ne 0 ]
115then
116 exit $?
117fi