blob: a16b1d507c29b7fd15075d4e3af4bc6716cc2ffd [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_williams7ae2ec72008-07-11 02:32:54 +000012while getopts 'vhs:b:' OPTION
david_williamsdb9a9592008-06-13 05:32:49 +000013do
14 case $OPTION in
15 h) usage
16 exit 1
17 ;;
18 v) verboseFlag=1
19 ;;
david_williams7ae2ec72008-07-11 02:32:54 +000020 s) stream=$OPTARG
21 ;;
david_williamsdb9a9592008-06-13 05:32:49 +000022 b) buildrepositorypath=$OPTARG
23 ;;
24 ?) usage
25 exit 2
26 ;;
27 esac
28done
david_williamsdb911a72008-06-11 15:34:10 +000029
david_williamsdb9a9592008-06-13 05:32:49 +000030shift $(($OPTIND - 1))
31
32
33
34# check we have the buildrepositorypath
35if [ -z $buildrepositorypath ]
david_williams7e38d0e2008-06-12 03:19:30 +000036then
david_williamsdb9a9592008-06-13 05:32:49 +000037 printf "\n\t%s\n" "Error: buildrepositorypath is required." >&2
38 usage
39 exit 1
david_williams7e38d0e2008-06-12 03:19:30 +000040fi
41
david_williamsdb9a9592008-06-13 05:32:49 +000042echo "buildrepositorypath: " $buildrepositorypath
david_williams77285892008-06-12 03:25:57 +000043
david_williamsdb9a9592008-06-13 05:32:49 +000044if [ -z $BUILD_INITIALIZED ]
45then
46 source properties.shsource
47 export BUILD_INITIALIZED=1
48fi
49
david_williams7ae2ec72008-07-11 02:32:54 +000050${JAVA_HOME}/bin/java -jar featureFileCreate.jar $stream $buildrepositorypath
david_williams9a66ead2008-06-12 04:17:37 +000051
52if [ "$?" -ne "0" ]
53then
54 exit $?
55fi
56
david_williamsdb9a9592008-06-13 05:32:49 +000057# copy to the build repository just for safe keeping, to be used later, if needed
david_williams98aede32008-07-11 02:27:09 +000058if [ -e wtp.sc ]
59then
60 cp wtp.sc $buildrepositorypath
61fi
62
63if [ -e features-ganymede-wtp.xml ]
64then
65 cp features-ganymede-wtp.xml $buildrepositorypath
66fi
67
68if [ -e features-europa-wtp.xml ]
69then
70 cp features-europa-wtp.xml $buildrepositorypath
71fi
72