blob: d003618b36d7e6e6a56d6df755d2b83b8bbfe1aa [file] [log] [blame]
david_williamsdb911a72008-06-11 15:34:10 +00001#!/bin/sh
david_williamsdb9a9592008-06-13 05:32:49 +00002#
3# Script to promote the latest build in the specified committers area
4#
david_williamsdb911a72008-06-11 15:34:10 +00005
david_williamsdb9a9592008-06-13 05:32:49 +00006function usage() {
7 printf "\n\tUsage: %s [-h] | [-v] -b buildrepositorypath " $(basename $0) >&2
david_williamsec22ecc2010-03-01 04:54:02 +00008 printf "\n\t\t%s\n\n" "where <buildrepositorypath> is similar to /shared/webtools/committers/wtp-R3.0-R/20080611172140/R-3.0-20080611172140/repository" >&2
david_williamsdb9a9592008-06-13 05:32:49 +00009}
david_williamsdb911a72008-06-11 15:34:10 +000010
david_williams7ae2ec72008-07-11 02:32:54 +000011while getopts 'vhs:b:' OPTION
david_williamsdb9a9592008-06-13 05:32:49 +000012do
13 case $OPTION in
14 h) usage
15 exit 1
16 ;;
17 v) verboseFlag=1
18 ;;
david_williams7ae2ec72008-07-11 02:32:54 +000019 s) stream=$OPTARG
20 ;;
david_williamsdb9a9592008-06-13 05:32:49 +000021 b) buildrepositorypath=$OPTARG
22 ;;
23 ?) usage
24 exit 2
25 ;;
26 esac
27done
david_williamsdb911a72008-06-11 15:34:10 +000028
david_williamsdb9a9592008-06-13 05:32:49 +000029shift $(($OPTIND - 1))
30
31
32
33# check we have the buildrepositorypath
34if [ -z $buildrepositorypath ]
david_williams7e38d0e2008-06-12 03:19:30 +000035then
david_williamsdb9a9592008-06-13 05:32:49 +000036 printf "\n\t%s\n" "Error: buildrepositorypath is required." >&2
37 usage
38 exit 1
david_williams7e38d0e2008-06-12 03:19:30 +000039fi
40
david_williamsdb9a9592008-06-13 05:32:49 +000041echo "buildrepositorypath: " $buildrepositorypath
david_williams77285892008-06-12 03:25:57 +000042
david_williamsdb9a9592008-06-13 05:32:49 +000043if [ -z $BUILD_INITIALIZED ]
44then
45 source properties.shsource
46 export BUILD_INITIALIZED=1
47fi
48
david_williams7ae2ec72008-07-11 02:32:54 +000049${JAVA_HOME}/bin/java -jar featureFileCreate.jar $stream $buildrepositorypath
david_williams9a66ead2008-06-12 04:17:37 +000050
51if [ "$?" -ne "0" ]
52then
53 exit $?
54fi
55
david_williamsdb9a9592008-06-13 05:32:49 +000056# copy to the build repository just for safe keeping, to be used later, if needed
david_williams98aede32008-07-11 02:27:09 +000057if [ -e wtp.sc ]
58then
59 cp wtp.sc $buildrepositorypath
60fi
61
62if [ -e features-ganymede-wtp.xml ]
63then
64 cp features-ganymede-wtp.xml $buildrepositorypath
65fi
66
67if [ -e features-europa-wtp.xml ]
68then
69 cp features-europa-wtp.xml $buildrepositorypath
70fi
71