blob: 23a87c076f2d53478a24d193b51b71404f97289c [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_williamsd9a5bd92009-08-12 03:09:36 +00008 printf "\n\t\t%s\n\n" "where h==help, v==verbose, c==clean and s==stream, where steam is Helios, Galileo, Ganymede, etc., " >&2
david_williams46fee5c2009-06-09 01:14:34 +00009 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"
david_williamsefa66f52009-06-09 07:46:05 +000071rsync -rp "${buildrepositorypath}"/* "${testUpdateSite}"
72rsync -p ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
73rsync -p ${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
david_williams53285422009-06-11 20:58:04 +000077CAP_BUILD=20090608042922/S-S20090608042922-20090608042922
78
79rsync -rp /shared/webtools/committers/wtpcap-R3.1-S/"${CAP_BUILD}"/updateSite/features/* "${testUpdateSite}"/features/
80rsync -rp /shared/webtools/committers/wtpcap-R3.1-S/"${CAP_BUILD}"/updateSite/plugins/* "${testUpdateSite}"/plugins/
david_williams46fee5c2009-06-09 01:14:34 +000081
82
83echo "add jaxws to site"
84
david_williams53285422009-06-11 20:58:04 +000085JAXWS_BUILD=I-I20090610182713-20090610182713
86
87rsync -rp "${HOME}"/downloads/webtools/downloads/drops/R0.5/"${JAXWS_BUILD}"/updateSite/features/* "${testUpdateSite}"/features/
88rsync -rp "${HOME}"/downloads/webtools/downloads/drops/R0.5/"${JAXWS_BUILD}"/updateSite/plugins/* "${testUpdateSite}"/plugins/
david_williams46fee5c2009-06-09 01:14:34 +000089
90
david_williams49c93ed2009-06-09 07:59:34 +000091./createMirrorFile.sh -s "$stream" -b "${testUpdateSite}"
david_williams98aede32008-07-11 02:27:09 +000092
david_williams7ae2ec72008-07-11 02:32:54 +000093if [ "$?" -ne 0 ]
david_williams28659b22008-06-12 03:48:43 +000094then
95 exit $?
96fi
97
david_williamsefa66f52009-06-09 07:46:05 +000098# re-create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +000099./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams4f1be032009-02-07 20:51:45 +0000100