david_williams | db911a7 | 2008-06-11 15:34:10 +0000 | [diff] [blame] | 1 | #!/bin/sh |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 2 | # |
| 3 | # Script to promote the latest build in the specified committers area |
| 4 | # |
david_williams | db911a7 | 2008-06-11 15:34:10 +0000 | [diff] [blame] | 5 | |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 6 | function usage() { |
| 7 | printf "\n\tUsage: %s [-h] | [-v] -b buildrepositorypath " $(basename $0) >&2 |
david_williams | ec22ecc | 2010-03-01 04:54:02 +0000 | [diff] [blame^] | 8 | 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_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 9 | } |
david_williams | db911a7 | 2008-06-11 15:34:10 +0000 | [diff] [blame] | 10 | |
david_williams | 7ae2ec7 | 2008-07-11 02:32:54 +0000 | [diff] [blame] | 11 | while getopts 'vhs:b:' OPTION |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 12 | do |
| 13 | case $OPTION in |
| 14 | h) usage |
| 15 | exit 1 |
| 16 | ;; |
| 17 | v) verboseFlag=1 |
| 18 | ;; |
david_williams | 7ae2ec7 | 2008-07-11 02:32:54 +0000 | [diff] [blame] | 19 | s) stream=$OPTARG |
| 20 | ;; |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 21 | b) buildrepositorypath=$OPTARG |
| 22 | ;; |
| 23 | ?) usage |
| 24 | exit 2 |
| 25 | ;; |
| 26 | esac |
| 27 | done |
david_williams | db911a7 | 2008-06-11 15:34:10 +0000 | [diff] [blame] | 28 | |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 29 | shift $(($OPTIND - 1)) |
| 30 | |
| 31 | |
| 32 | |
| 33 | # check we have the buildrepositorypath |
| 34 | if [ -z $buildrepositorypath ] |
david_williams | 7e38d0e | 2008-06-12 03:19:30 +0000 | [diff] [blame] | 35 | then |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 36 | printf "\n\t%s\n" "Error: buildrepositorypath is required." >&2 |
| 37 | usage |
| 38 | exit 1 |
david_williams | 7e38d0e | 2008-06-12 03:19:30 +0000 | [diff] [blame] | 39 | fi |
| 40 | |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 41 | echo "buildrepositorypath: " $buildrepositorypath |
david_williams | 7728589 | 2008-06-12 03:25:57 +0000 | [diff] [blame] | 42 | |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 43 | if [ -z $BUILD_INITIALIZED ] |
| 44 | then |
| 45 | source properties.shsource |
| 46 | export BUILD_INITIALIZED=1 |
| 47 | fi |
| 48 | |
david_williams | 7ae2ec7 | 2008-07-11 02:32:54 +0000 | [diff] [blame] | 49 | ${JAVA_HOME}/bin/java -jar featureFileCreate.jar $stream $buildrepositorypath |
david_williams | 9a66ead | 2008-06-12 04:17:37 +0000 | [diff] [blame] | 50 | |
| 51 | if [ "$?" -ne "0" ] |
| 52 | then |
| 53 | exit $? |
| 54 | fi |
| 55 | |
david_williams | db9a959 | 2008-06-13 05:32:49 +0000 | [diff] [blame] | 56 | # copy to the build repository just for safe keeping, to be used later, if needed |
david_williams | 98aede3 | 2008-07-11 02:27:09 +0000 | [diff] [blame] | 57 | if [ -e wtp.sc ] |
| 58 | then |
| 59 | cp wtp.sc $buildrepositorypath |
| 60 | fi |
| 61 | |
| 62 | if [ -e features-ganymede-wtp.xml ] |
| 63 | then |
| 64 | cp features-ganymede-wtp.xml $buildrepositorypath |
| 65 | fi |
| 66 | |
| 67 | if [ -e features-europa-wtp.xml ] |
| 68 | then |
| 69 | cp features-europa-wtp.xml $buildrepositorypath |
| 70 | fi |
| 71 | |