shithub: iso

ref: d8cfde2cec4127fff11f9ad889572a49b1cb27f8
dir: /bin/nightlyiso.rc/

View raw version
#!/bin/rc
rfork en

flagfmt='f:force'
eval `{aux/getflags $*}

home=/usr/build

cd $home/code/plan9front
git/pull
prev=`{cat prev}
head=`{git/query HEAD}
rev=`{git/log -s | wc -l}
release=9front-$rev
log=$home/www/9front/^$release^.log
res=$home/www/9front/$rev.status
echo release $release

if(~ $prev $head && ~ $force '')
	exit

buildisos.rc >$log >[2=1]
date >>$log
if(~ `{ls $home/www/9front/*gz | grep $rev | wc -l} 6){
	echo pass >$res
	echo $rev >$home/www/9front/latest
}
if not
	echo fail >$res

echo $head >>$res
echo $head >prev

#garbage collection
latest=`{cat $home/www/9front/latest}
for(i in `{ls $home/www/9front | grep -v $latest | grep '\.(iso|gz|img|qcow2)$'})
	rm $i