3
# Copyright (C) 2007 MySQL AB
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 2 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
#############################################################
19
# This script created by Jonas does the following #
20
# Cleans up clones and pevious builds, pulls new clones, #
21
# builds, deploys, configures the tests and launches ATRT #
22
#############################################################
29
VERSION="upgrade-boot.sh version 1.00"
31
DATE=`date '+%Y-%m-%d'`
37
echo "`date` starting: $*"
48
LOCK=$HOME/.autotest-lock
50
############################
51
# Read command line entries#
52
############################
57
--no-clone) do_clone="";;
58
--no-build) build="";;
59
--verbose) verbose=`expr $verbose + 1`;;
60
--clone=*) clone0=`echo $1 | sed s/--clone=//`;;
61
--clone0=*) clone0=`echo $1 | sed s/--clone0=//`;;
62
--clone1=*) clone1=`echo $1 | sed s/--clone1=//`;;
63
--version) echo $VERSION; exit;;
64
--conf=*) conf=`echo $1 | sed s/--conf=//`;;
65
--tag=*) tag0=`echo $1 | sed s/--tag=//`;;
66
--tag0=*) tag0=`echo $1 | sed s/--tag0=//`;;
67
--tag1=*) tag1=`echo $1 | sed s/--tag1=//`;;
68
--*) echo "Unknown arg: $1";;
81
echo "No tag0 specified"
87
echo "No tag1 specified"
91
#################################
92
#Make sure the configfile exists#
93
#if it does not exit. if it does#
95
#################################
98
if [ -f "`pwd`/autotest.conf" ]
100
conf="`pwd`/autotest.conf"
101
elif [ -f "$HOME/autotest.conf" ]
103
conf="$HOME/autotest.conf"
111
echo "Can't find config file: >$conf<"
115
###############################
116
# Validate that all interesting
117
# variables where set in conf
118
###############################
119
vars="src_clone_base install_dir build_dir"
123
if [ -z "`eval $t`" ]
125
echo "Invalid config: $conf, variable $i is not set"
130
###############################
131
#Print out the enviroment vars#
132
###############################
134
if [ $verbose -gt 0 ]
139
####################################
140
# Setup the lock file name and path#
141
# Setup the clone source location #
142
####################################
144
src_clone0=${src_clone_base}${clone0}
145
src_clone1=${src_clone_base}${clone1}
147
#######################################
148
# Check to see if the lock file exists#
150
#######################################
154
echo "Lock file exists: $LOCK"
158
#######################################
159
# If the lock file does not exist then#
160
# create it with date and run info #
161
#######################################
163
echo "$DATE $RUN" > $LOCK
165
#############################
166
#If any errors here down, we#
167
# trap them, and remove the #
168
# Lock file before exit #
169
#############################
170
if [ `uname -s` != "SunOS" ]
172
trap "rm -f $LOCK" ERR
175
# You can add more to this path#
176
################################
178
dst_place0=${build_dir}/clone-$tag0-$DATE.$$
179
dst_place1=${build_dir}/clone-$tag1-$DATE.$$
181
#########################################
182
# Delete source and pull down the latest#
183
#########################################
187
rm -rf $dst_place0 $dst_place1
188
if [ `echo $src_clone0 | grep -c 'file:\/\/'` = 1 ]
190
bk clone -l -r$tag0 $src_clone0 $dst_place0
192
bk clone -r$tag0 $src_clone0 $dst_place0
195
if [ `echo $src_clone1 | grep -c 'file:\/\/'` = 1 ]
197
bk clone -l -r$tag1 $src_clone1 $dst_place1
199
bk clone -r$tag1 $src_clone1 $dst_place1
203
##########################################
204
# Build the source, make installs, and #
205
# create the database to be rsynced #
206
##########################################
207
install_dir0=$install_dir/$tag0
208
install_dir1=$install_dir/$tag1
213
BUILD/compile-ndb-autotest --prefix=$install_dir0
218
BUILD/compile-ndb-autotest --prefix=$install_dir1
223
################################
225
################################
227
script=$install_dir1/mysql-test/ndb/upgrade-run.sh
228
$script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock $extra_args
232
rm -rf $dst_place0 $dst_place1