shithub: iso

ref: 3f41864567637e51424fa721078604eec88628b3
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} 7){
	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