blob: 816670ba87b00f26a53f5b42ab421a0f3f31b2de [file] [log] [blame]
david_williamsdb911a72008-06-11 15:34:10 +00001#!/bin/sh
david_williamsdb9a9592008-06-13 05:32:49 +00002#!/usr/bin/env bash
3#
4# Script to promote the latest build in the specified committers area
5#
david_williamsdb911a72008-06-11 15:34:10 +00006
david_williamsdb9a9592008-06-13 05:32:49 +00007function usage() {
8 printf "\n\tUsage: %s [-h] | [-v] -b buildrepositorypath " $(basename $0) >&2
9 printf "\n\t\t%s\n\n" "where <buildrepositorypath> is similar to /shared/webtools/committers/wtp-R3.0-R/20080611172140/R-3.0-20080611172140/updateSite" >&2
10}
david_williamsdb911a72008-06-11 15:34:10 +000011
david_williamsdb9a9592008-06-13 05:32:49 +000012buildrepositorypath=
13while getopts 'vhb:' OPTION
14do
15 case $OPTION in
16 h) usage
17 exit 1
18 ;;
19 v) verboseFlag=1
20 ;;
21 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
49${JAVA_HOME}/bin/java -jar featureFileCreate.jar $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
57cp wtp.sc $buildrepositorypath
58cp features-ganymede-wtp.xml $buildrepositorypath