blob: 534f35f5d74392878b6c3ca14328f5c3e158e80e [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_williams98152932009-09-11 16:09:21 +000029 b) 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_williamsd55bd202009-11-21 17:59:15 +000069
70WTP_DEFAULT=I-3.2.0-20091119201510
71
david_williams98152932009-09-11 16:09:21 +000072# if not provided, we'll use the one coded here
david_williams78bd9f62009-09-11 16:31:38 +000073if [ -z "${buildrepositorypath}" ]
david_williams98152932009-09-11 16:09:21 +000074then
david_williamsb8d25bb2010-01-15 07:00:12 +000075 echo "Using default build repository path"
david_williamsec22ecc2010-03-01 04:54:02 +000076 buildrepositorypath=${HOME}/downloads/webtools/downloads/drops/R3.2.0/"${WTP_DEFAULT}"/repository/
david_williams0a488172009-09-11 16:29:19 +000077else
david_williamsb8d25bb2010-01-15 07:00:12 +000078 echo "Using the provided build repository path"
david_williams0a488172009-09-11 16:29:19 +000079 echo "buildrepositorypath: " "${buildrepositorypath}"
david_williams98152932009-09-11 16:09:21 +000080fi
david_williamsc211f982009-09-11 16:24:44 +000081
david_williams0a488172009-09-11 16:29:19 +000082
david_williamsc211f982009-09-11 16:24:44 +000083if [ -d "${buildrepositorypath}" ]
84then
85 echo " Updating index and web site files, and site.xml file"
86 rsync -vrp "${buildrepositorypath}"/* "${testUpdateSite}"
87else
88 echo " build repo directory does not exisit"
89 echo " buildrepositorypath: $buildrepositorypath"
90 exit 99
91fi
92
david_williams0ae00bb2009-08-14 03:43:09 +000093rsync -vp ${HOME}/${updateToolsDir}/WebContent/${mainIndexFileName} ${testUpdateSite}/index.html
94rsync -vp ${HOME}/${updateToolsDir}/WebContent/*.jpg ${testUpdateSite}
david_williams8015a282008-02-24 22:21:58 +000095
david_williams1991c9c2010-03-16 06:51:22 +000096echo "add capabilities to repository"
david_williams46fee5c2009-06-09 01:14:34 +000097
david_williams1991c9c2010-03-16 06:51:22 +000098CAP_BUILD=20090622054830/I-3.2I-20090622054830
david_williams53285422009-06-11 20:58:04 +000099
david_williams1991c9c2010-03-16 06:51:22 +0000100rsync -vrp /shared/webtools/committers/wtpcap-R3.2-I/"${CAP_BUILD}"/repository/features/* "${testUpdateSite}"/features/
101rsync -vrp /shared/webtools/committers/wtpcap-R3.2-I/"${CAP_BUILD}"/repository/plugins/* "${testUpdateSite}"/plugins/
102
103echo "add xml-security to repository"
104
105XMLSEC_BUILD=20100126050534/I-I20100126050534-20100126050534
106
107rsync -vrp /shared/webtools/committers/xmlsec-R0.5-I/"${XMLSEC_BUILD}"/repository/features/* "${testUpdateSite}"/features/
108rsync -vrp /shared/webtools/committers/xmlsec-R0.5-I/"${XMLSEC_BUILD}"/repository/plugins/* "${testUpdateSite}"/plugins/
david_williams46fee5c2009-06-09 01:14:34 +0000109
110
david_williams49c93ed2009-06-09 07:59:34 +0000111./createMirrorFile.sh -s "$stream" -b "${testUpdateSite}"
david_williams98aede32008-07-11 02:27:09 +0000112
david_williams7ae2ec72008-07-11 02:32:54 +0000113if [ "$?" -ne 0 ]
david_williams28659b22008-06-12 03:48:43 +0000114then
115 exit $?
116fi
117
david_williamsefa66f52009-06-09 07:46:05 +0000118# re-create P2 repository metadata
david_williamsdb911a72008-06-11 15:34:10 +0000119./ant.sh -f createP2Repo.xml -Declipse.home=${eclipseLocation} -Dupdate.site=${testUpdateSite}
david_williams4f1be032009-02-07 20:51:45 +0000120