Revamped automated build system to use a Python script for the master
control script, make parallel builds the only way to do it (facilitated by the taskrunner module) split out the guts of build-all into separate scripts, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
94
wxPython/distrib/all/build-rpm
Executable file
94
wxPython/distrib/all/build-rpm
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
set -o errexit
|
||||
|
||||
# read the config variables from the file given on the command line
|
||||
. $1
|
||||
|
||||
coHost=$2
|
||||
host=$3
|
||||
reltag=$4
|
||||
shift;shift;shift;shift
|
||||
pyver=$@
|
||||
|
||||
|
||||
function TestOnline {
|
||||
local host=$1
|
||||
local message=$2
|
||||
|
||||
if ping -q -c1 -w1 $host > /dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [ $skiplinux != yes ]; then
|
||||
|
||||
startedCoHost=no
|
||||
hostAvailable=no
|
||||
|
||||
# test if the target machine is online
|
||||
if TestOnline $host; then
|
||||
hostAvailable=yes
|
||||
else
|
||||
# Attempt to start the host via it's coLinux host, if there is one
|
||||
if [ $coHost != none ]; then
|
||||
if TestOnline $coHost; then
|
||||
echo "Attempting to start $host via coLinux on $coHost..."
|
||||
ssh $coHost "/c/coLinux/VMs/$host.bat -d > /dev/null 2>&1 &"
|
||||
|
||||
# Give it time to boot and be ready for conenctions,
|
||||
# and then test with ssh, limiting retries.
|
||||
for x in `seq 12`; do
|
||||
sleep 5
|
||||
echo "checking..."
|
||||
if ssh root@$host "true" >/dev/null 2>&1; then
|
||||
# success! the host is ready so we can break out of the loop
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
# test if the host is ready
|
||||
if TestOnline $host; then
|
||||
echo "coLinux start of $host on $coHost successful."
|
||||
startedCoHost=yes
|
||||
hostAvailable=yes
|
||||
fi
|
||||
else
|
||||
echo "The $coHost machine is offline, unable to start coLinux for $host"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $hostAvailable = yes ]; then
|
||||
echo "The $host machine is online, build continuing..."
|
||||
else
|
||||
echo "The $host machine is **OFFLINE**, skipping the binary RPM build."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
echo "Copying source files and build script..."
|
||||
ssh root@$host "mkdir -p $LINUX_BUILD && rm -rf $LINUX_BUILD/*"
|
||||
scp $STAGING_DIR/wxPython-src* $STAGING_DIR/wxPython.spec\
|
||||
distrib/all/do-build-rpm \
|
||||
root@$host:$LINUX_BUILD
|
||||
|
||||
echo "Running build script on $host..."
|
||||
cmd=./do-build-rpm
|
||||
ssh root@$host "cd $LINUX_BUILD && $cmd $reltag $skipclean $VERSION $pyver"
|
||||
|
||||
echo "Fetching the results..."
|
||||
scp "root@$host:$LINUX_BUILD/wxPython*.i[0-9]86.rpm" $STAGING_DIR
|
||||
ssh root@$host "rm $LINUX_BUILD/wxPython*.i[0-9]86.rpm"
|
||||
|
||||
|
||||
if [ $startedCoHost = yes ]; then
|
||||
echo "Halting $host on $coHost..."
|
||||
ssh root@$host "/sbin/halt"
|
||||
sleep 10
|
||||
fi
|
||||
fi
|
Reference in New Issue
Block a user