source: ProjectBuilder/0.8.11/pb/contrib/newpbqemu @ 281

Last change on this file since 281 was 281, checked in by Bruno Cornec, 13 years ago

Fix build process for older distro + add new test scripts for delivery

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3(
4if [ _"$1" == _"" ]; then
5    echo "Syntax: newpbqemu VM|all"
6    exit -1
7fi
8
9export PBPROJ=pb
10export PBROOT=/users/bruno/pb/svn/devel
11
12if [ _"$1" == _"all" ]; then
13    opt="`grep vmlist  $PBROOT/pbconf/pb.pb | grep pb | cut -d= -f2 | sed 's/,/ /g'`"
14    opt64="`echo $opt | sed 's/ /_64 /g'`"
15    opt="$opt $opt64"
16else
17    opt="`echo $* | sed 's/,/ /g'`"
18fi
19
20echo "Working on VMs: $opt"
21for m in $opt; do
22    echo "Launching script on $m"
23    cat > /tmp/pbscript << EOF
24    ntpdate ntp.home.musique-ancienne.org
25    rm -rf project-builder-*
26    wget --passive-ftp ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz
27    tar xvfz project-builder-latest.tar.gz
28    cd project-builder-*
29    perl Makefile.PL
30    make
31    make install
32    cd ..
33EOF
34    pb -m $m -a root -s /tmp/pbscript script2vm
35    pb -m $m build2vm
36    echo "Installing package on $m"
37    cat > /tmp/pbscript << EOF
38    #!/bin/bash
39    ddir=`pbdistrocheck | cut -d: -f2 | cut -d, -f1`
40    dver=`pbdistrocheck | cut -d, -f2`
41    dtype=`pbdistrocheck | cut -d, -f4`
42    dsuf=`pbdistrocheck | cut -d, -f5`
43    pbver=0.8.11
44    if [ "$dtype" = "rpm" ]; then
45        rpm -Uvh --force --nodeps ftp://ftp.project-builder.org/$ddir/$dver/project-builder-$pbver-1$dsuf.noarch.rpm"
46    else
47        wget ftp://ftp.project-builder.org/$ddir/$dver/project-builder_".$pbver."_all.deb
48        dpkg -i project-builder_".$pbver."_all.deb"
49    fi
50EOF
51    pb -m $m -a root -s /tmp/pbscript script2vm
52    echo "Halting $m"
53    echo "/sbin/halt -p" > /tmp/pbscript
54    pb -m $m -a root -s /tmp/pbscript script2vm
55    sleep 120
56    job=`ps auhxww | grep qemu | grep $m | grep -Ev 'grep|updateqemu' | awk '{print $2}'`
57    if [ _"$job" != _"" ]; then
58        echo "Really halting $m"
59        kill $job
60    fi
61done
62) 2>&1 | tee /tmp/newpbqemu.log
Note: See TracBrowser for help on using the repository browser.