Commit a910ffa2 authored by Rich Prohaska's avatar Rich Prohaska

fix error codes in tokutek's build script

parent b1eada07
...@@ -10,28 +10,35 @@ function usage() { ...@@ -10,28 +10,35 @@ function usage() {
# copy build files to amazon s3 # copy build files to amazon s3
function copy_to_s3() { function copy_to_s3() {
local s3_build_bucket=$1; local s3_release_bucket=$2 local s3_build_bucket=$1; local s3_release_bucket=$2
local exitcode=0; local r=0
for f in $(ls *.tar.gz*); do for f in $(ls *.tar.gz*); do
echo `date` s3put $s3_build_bucket $f echo `date` s3put $s3_build_bucket $f
s3put $s3_build_bucket $f $f s3put $s3_build_bucket $f $f
exitcode=$? r=$?
# index the file by date # index the file by date
echo `date` s3put $s3_build_bucket $f $exitcode echo `date` s3put $s3_build_bucket $f $r
if [ $r != 0 ] ; then exitcode=1; fi
d=$(date +%Y%m%d) d=$(date +%Y%m%d)
s3put $s3_build_bucket-date $d/$f /dev/null s3put $s3_build_bucket-date $d/$f /dev/null
exitcode=$? r=$?
echo `date` s3put $s3_build_bucket-date $d/$f $exitcode echo `date` s3put $s3_build_bucket-date $d/$f $r
if [ $r != 0 ] ; then exitcode=1; fi
done done
if [[ $git_tag =~ tokudb-.* ]] ; then if [[ $git_tag =~ tokudb-.* ]] ; then
s3mkbucket $s3_release_bucket-$git_tag s3mkbucket $s3_release_bucket-$git_tag
if [ $? = 0 ] ; then if [ $r != 0 ] ; then
exitcode=1
else
for f in $(ls *.tar.gz*); do for f in $(ls *.tar.gz*); do
echo `date` s3copykey $s3_release_bucket-$git_tag $f echo `date` s3copykey $s3_release_bucket-$git_tag $f
s3copykey $s3_release_bucket-$git_tag $f tokutek-mysql-build $f s3copykey $s3_release_bucket-$git_tag $f tokutek-mysql-build $f
exitcode=$? r=$?
echo `date` s3copykey $s3_release_bucket-$git_tag $f $exitcode echo `date` s3copykey $s3_release_bucket-$git_tag $f $r
if [ $r != 0 ] ; then exitcode=1; fi
done done
fi fi
fi fi
test $exitcode = 0
} }
mysqlbuild= mysqlbuild=
...@@ -45,6 +52,7 @@ pushd $(dirname $0) ...@@ -45,6 +52,7 @@ pushd $(dirname $0)
source ./common.sh source ./common.sh
popd popd
exitcode=0
make_args= make_args=
while [ $# -gt 0 ] ; do while [ $# -gt 0 ] ; do
arg=$1; shift arg=$1; shift
...@@ -65,9 +73,11 @@ parse_mysqlbuild $mysqlbuild ...@@ -65,9 +73,11 @@ parse_mysqlbuild $mysqlbuild
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
# make the build dir # make the build dir
mkdir build-tokudb-$tokudb_version build_dir=build-tokudb-$tokudb_version
if [ -d builds ] ; then build_dir=builds/$build_dir; fi
mkdir $build_dir
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
pushd build-tokudb-$tokudb_version pushd $build_dir
# make mysql # make mysql
bash -x $HOME/github/ft-engine/scripts/make.mysql.new.bash $make_args bash -x $HOME/github/ft-engine/scripts/make.mysql.new.bash $make_args
...@@ -78,13 +88,15 @@ files=$(ls $mysql_distro/build.*/*.tar.gz) ...@@ -78,13 +88,15 @@ files=$(ls $mysql_distro/build.*/*.tar.gz)
for f in $(ls $mysql_distro/build.*/*.tar.gz) ; do for f in $(ls $mysql_distro/build.*/*.tar.gz) ; do
newf=$(basename $f) newf=$(basename $f)
ln $f $newf ln $f $newf
if [ $? != 0 ] ; then exitcode=1; fi
md5sum $newf >$newf.md5 md5sum $newf >$newf.md5
if [ $? != 0 ] ; then exitcode=1; fi
done done
# copy to s3 # copy to s3
if [ $s3 != 0 ] ; then if [ $s3 != 0 ] ; then
copy_to_s3 $s3_build_bucket $s3_release_bucket copy_to_s3 $s3_build_bucket $s3_release_bucket
exitcode=$? if [ $? != 0 ] ; then exitcode=1; fi
fi fi
popd popd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment