blob: d81f94fe3ea952a4dc510b75cdf14e8237efeb32 [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_williams46fee5c2009-06-09 01:14:34 +00008 printf "\n\t\t%s\n\n" "where h==help, v==verbose, c==clean and s==stream, where steam is Galileo, Ganymede, etc., " >&2
9 printf "\n\t\t%s\n\n" " and b is absolute path to directory of update site repository " >&2
10
david_williamsdb9a9592008-06-13 05:32:49 +000011}
12
david_williamsd4c67152008-06-13 05:42:23 +000013
david_williamsdb9a9592008-06-13 05:32:49 +000014clean=
15stream=
david_williams649ad682008-06-13 05:47:57 +000016verbose=
david_williamsf4ea4b12008-06-13 05:53:29 +000017while getopts 'hvcs:b:' OPTION
david_williamsdb9a9592008-06-13 05:32:49 +000018do
19 case $OPTION in
20 h) usage
21 exit 1
22 ;;
david_williamsf4ea4b12008-06-13 05:53:29 +000023 c) export clean=1
david_williamsdb9a9592008-06-13 05:32:49 +000024 ;;
david_williamsf4ea4b12008-06-13 05:53:29 +000025 v) export verbose=1
david_williams649ad682008-06-13 05:47:57 +000026 ;;
27 s) stream=$OPTARG
david_williamsf4ea4b12008-06-13 05:53:29 +000028 ;;
david_williams3f1d45a2008-06-13 06:26:17 +000029 b) export buildrepositorypath=$OPTARG
david_williamsf4ea4b12008-06-13 05:53:29 +000030 ;;
david_williamsdb9a9592008-06-13 05:32:49 +000031 ?) usage
32 exit 2
33 ;;
34 esac
35done
36
37shift $(($OPTIND - 1))
38
david_williamsd4c67152008-06-13 05:42:23 +000039if [ -z $stream ]
david_williamsb9598612008-06-13 05:45:11 +000040then
david_williamsd4c67152008-06-13 05:42:23 +000041 echo ""
42 echo " Need a stream argument"
43 usage
44 exit 1
45fi
46
david_williams98aede32008-07-11 02:27:09 +000047echo " Stream: " $stream
48
david_williamsdb9a9592008-06-13 05:32:49 +000049if [ -z $BUILD_INITIALIZED ]
50then
51 source properties.shsource
52 source parseSiteArg.shsource $stream
53 export BUILD_INITIALIZED=1
54fi
55
56
57if [ $clean ] ; then
david_williams47f61222007-02-10 18:50:15 +000058
david_williams72901652008-05-28 04:30:46 +000059 echo " Removing ${testUpdateSite}/features/"
60 rm -fr ${testUpdateSite}/features/
david_williams47f61222007-02-10 18:50:15 +000061
david_williams72901652008-05-28 04:30:46 +000062 echo " Removing ${testUpdateSite}/plugins/"
63 rm -fr ${testUpdateSite}/plugins/
david_williams47f61222007-02-10 18:50:15 +000064
65 echo " Removing index and site xml files"
david_williams72901652008-05-28 04:30:46 +000066 rm -fr ${testUpdateSite}/*
david_williams8015a282008-02-24 22:21:58 +000067
david_williams843da282007-05-26 20:58:37 +000068fi
david_williams8015a282008-02-24 22:21:58 +000069
david_williamsf2ed02a2009-06-09 02:13:13 +000070echo " Updating index and web site files, and site.xml file"
71rsync -rpua "${buildrepositorypath}"/* "${testUpdateSite}"
72rsync -pua ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
73rsync -pua ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
david_williams8015a282008-02-24 22:21:58 +000074
david_williams46fee5c2009-06-09 01:14:34 +000075echo "add capabilities to site"
76
77rsync -rpua /shared/webtools/committers/wtpcap-R3.1-S/20090608042922/S-S20090608042922-20090608042922/updateSite/features/* "${testUpdateSite}"/features/
78rsync -rpua /shared/webtools/committers/wtpcap-R3.1-S/20090608042922/S-S20090608042922-20090608042922/updateSite/plugins/* "${testUpdateSite}"/plugins/
79
80
81echo "add jaxws to site"
82
83rsync -rpua "${HOME}"/downloads/webtools/downloads/drops/R0.5/I-I20090528002428-20090528002428/updateSite/features/* "${testUpdateSite}"/features/
84rsync -rpua "${HOME}"/downloads/webtools/downloads/drops/R0.5/I-I20090528002428-20090528002428/updateSite/plugins/* "${testUpdateSite}"/plugins/
85
86
david_williams7ae2ec72008-07-11 02:32:54 +000087./createMirrorFile.sh -s "$stream" -b "$buildrepositorypath"
david_williams98aede32008-07-11 02:27:09 +000088
david_williams7ae2ec72008-07-11 02:32:54 +000089if [ "$?" -ne 0 ]
david_williams28659b22008-06-12 03:48:43 +000090then
91 exit $?
92fi
93
david_williams60d00142008-05-28 02:32:50 +000094# create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +000095./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams4f1be032009-02-07 20:51:45 +000096
97if [ "$?" -ne 0 ]
98then
99 exit $?
100fi