Commit 7569a350 authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

Updated build tools to match those in squeeze

parent c1fe5ff6
......@@ -315,7 +315,6 @@ rsync_args = %w(
rsync_excludes = %w(*/ Makefile Rakefile TODO README .hgignore AUTOBUILD .hgtags)
hg_number = `hg id -n -r tip`.chomp
release = "current"
file "#{ENV['HOME']}/htdocs/#{hg_number}/Release.gpg" => "Release.gpg" do |t|
cmd = %w(rsync) + rsync_args
......@@ -323,21 +322,21 @@ file "#{ENV['HOME']}/htdocs/#{hg_number}/Release.gpg" => "Release.gpg" do |t|
cmd << "--exclude '#{ex}'"
end
sh "#{cmd.join(" ")} --times $PWD/ #{ENV['HOME']}/htdocs/#{hg_number}"
rm "#{ENV['HOME']}/htdocs/#{release}"
rm "#{ENV['HOME']}/htdocs/#{DISTRO}"
end
file "#{ENV["HOME"]}/htdocs/#{release}" => "#{ENV['HOME']}/htdocs/#{hg_number}/Release.gpg" do |t|
sh "cd #{ENV["HOME"]}/htdocs && ln -sf #{hg_number} #{release}"
file "#{ENV["HOME"]}/htdocs/#{DISTRO}" => "#{ENV['HOME']}/htdocs/#{hg_number}/Release.gpg" do |t|
sh "cd #{ENV["HOME"]}/htdocs && ln -sf #{hg_number} #{DISTRO}"
end
AVAILABLE_BUILD_ARCH.each do |arch|
file "#{ENV["HOME"]}/htdocs/#{release}/#{arch}" => "#{ENV["HOME"]}/htdocs/#{release}" do |t|
file "#{ENV["HOME"]}/htdocs/#{DISTRO}/#{arch}" => "#{ENV["HOME"]}/htdocs/#{DISTRO}" do |t|
sh "cd #{t.prerequisites.first} && ln -sf . #{arch}"
end
end
desc "Upload packages to the local tree"
task "upload" => AVAILABLE_BUILD_ARCH.collect{|arch| "#{ENV["HOME"]}/htdocs/#{release}/#{arch}"}
task "upload" => AVAILABLE_BUILD_ARCH.collect{|arch| "#{ENV["HOME"]}/htdocs/#{DISTRO}/#{arch}"}
desc "Upload packages to mirror. !DANGER!"
task "upload-live" => ["#{ENV['HOME']}/htdocs/lenny"] + AVAILABLE_BUILD_ARCH.collect{|arch| "#{ENV["HOME"]}/htdocs/lenny/#{arch}"} do |t|
......
......@@ -14,16 +14,22 @@
# --
#
REPO=Symbiosis
SRC=https://projects.bytemark.co.uk/hg/$REPO
DST=$HOME/$REPO
LOCK=$DST/$REPO-builder.lck
#
# Set up some default values
#
REPO=${REPO:-symbiosis}
SRC=${SRC:-https://projects.bytemark.co.uk/hg/$REPO}
DST=${DST:-$HOME/$REPO}
LOCK=${LOCK:-$DST/$REPO-builder.lck}
LOGFILE=${LOGFILE:-$DST/$REPO-builder.$$.log}
ERRFILE=${ERRFILE:-$DST/$REPO-builder.$$.err}
MAILTO=${MAILTO:-patrick@bytemark.co.uk}
LOGFILE=$DST/$REPO-builder.$$.log
ERRFILE=$DST/$REPO-builder.$$.err
MAILTO="patrick@bytemark.co.uk"
GUESTNAME=${GUESTNAME:-$REPO-tester}
GUESTNAME=symtester
FORCE=${FORCE:-}
#
# Exit on errors
......
......@@ -16,28 +16,28 @@ for arch in i386 amd64 ; do
#
# If we already have an image, carry on.
#
if [ -d /shared/images/symtester/$distro/$arch/run ] ; then
echo Image for symtester/$distro/$arch already exists
if [ -d /shared/images/$GUESTNAME/$distro/$arch/run ] ; then
echo Image for $GUESTNAME/$distro/$arch already exists
continue
fi
#
# If the guest exists.
#
if [ -d /shared/guests/symtester/ ]; then
sudo km delete symtester
if [ -d /shared/guests/$GUESTNAME/ ]; then
sudo km delete $GUESTNAME
fi
#
# Recreate
#
sudo km-provision --pass=$passwd --ip=89.16.160.206 \
--name=symtester --arch=$arch \
--name=$GUESTNAME --arch=$arch \
--key=$HOME/.ssh/id_rsa.pub \
--imager=http://imager3.bytemark.co.uk:5000 \
--dist=$distro \
--nostart
sudo cp -R /shared/guests/symtester/* /shared/images/symtester/$distro/$arch
sudo cp -R /shared/guests/$GUESTNAME/* /shared/images/$GUESTNAME/$distro/$arch
done
done
......@@ -2,9 +2,13 @@
set -e
mkdir -p /srv/symtester/config/
touch /srv/symtester/config/antivirus
touch /srv/symtester/config/antispam
GUESTNAME=${GUESTNAME:-symtester}
BUILDER=${BUILDER:-symbiosis-builder.sh.bytemark.co.uk}
PACKAGE_DIR=${PACKAGE_DIR:-current}
mkdir -p "/srv/$GUESTNAME.test/config/"
touch "/srv/$GUESTNAME.test/config/antivirus"
touch "/srv/$GUESTNAME.test/config/antispam"
#
# Start spam & anti-virus bits
......@@ -33,7 +37,7 @@ sleep 20
# package1,version1
# package2,version2
#
pkgvers=`wget -q -O - http://symbiosis-builder.sh.bytemark.co.uk/current/Packages | grep '^\(Package\|Version\)' | sed -n 'N;s/\(Package\|Version\): //g;s/\n/,/;p' | uniq`
pkgvers=`wget -q -O - http://$BUILDER/$PACKAGE_DIR/Packages | grep '^\(Package\|Version\)' | sed -n 'N;s/\(Package\|Version\): //g;s/\n/,/;p' | uniq`
for pkgver in $pkgvers ; do
pkg=${pkgver%,*}
......
......@@ -2,6 +2,8 @@
set -e
BUILDER=${BUILDER:-symbiosis-builder.sh.bytemark.co.uk}
PACKAGE_DIR=${PACKAGE_DIR:-current}
#
# Make sure we're up to date
......@@ -23,7 +25,7 @@ echo "Changing package lists..."
#
# Now change the package lists
#
sed -i -e 's#http://\(vhost\|symbiosis\).bytemark.co.uk/lenny#http://symbiosis-builder.sh.bytemark.co.uk/current#g' /etc/apt/sources.list{,.security}
sed -i -e "s#http://\(vhost\|symbiosis\).bytemark.co.uk/[^ ]\+#http://$BUILDER/$PACKAGE_DIR#g" /etc/apt/sources.list{,.security}
echo "Doing second upgrade..."
#
......
Supports Markdown
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