shithub: iso

ref: 8fa9d99424da17b8ac3e67fb6d5563bf71f51e56
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} 8){
	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