--- loncom/build/install_web_site_cronjob 2002/07/19 19:53:34 1.1 +++ loncom/build/install_web_site_cronjob 2004/07/06 15:44:07 1.8 @@ -16,30 +16,85 @@ as loninst and crontab C<-l>; to edit lo loninst and crontab C<-e>). This file should be on the B filesystem as -F. +F. The current 'loninst' crontab entry is: -13 16 * * * /home/loninst/auto/autotardist +13 16 * * * /home/loninst/auto/install_web_site_cronjob -The main goal of B is to periodically produce the -tarball needed for LON-CAPA installation. +The main goal of B is to periodically produce the +unstable tarball needed for LON-CAPA installation. -A secondary yet important function of B is that it +A secondary yet important function of B is that it also refreshes the documentation present on the install.lon-capa.org web site. +This documentation is refreshed based on a file located inside +F. This file is named +F, where +I is the latest stable release of loncapa (e.g. 0.4 or 0.6.1). +The F file contains a string +that is used to date the release of the current stable version. + The coding of this script is a strange brew of shell commands with perl. =head1 AUTHOR -Scott Harrison 2002-07-19 =cut # --------------------------------------------- Making the tarball distribution -`cd /home/loninst/auto; export CVS_PASSFILE=/home/loninst/.cvspass; export CVSROOT=:pserver:scott\@localhost:/home/cvs; rm -Rf loncapa/[C][^V]*; rm -Rf loncapa/[^C]*; cvs -Q co loncapa; cd loncapa/loncom/build; make build 2>/dev/null; make tardist;`; + +# In an ideal world, this tarball distribution would be always generated with +# the "make tardist" command. But instead, unstable is now defined as +# "all the gunk we have been working on", whereas the +# "make tardist" command means a "carefully inventoried selection of gunk". +#`cd /home/loninst/auto; export CVS_PASSFILE=/home/loninst/.cvspass; export CVSROOT=:pserver:scott\@localhost:/home/cvs; rm -Rf loncapa/[C][^V]*; rm -Rf loncapa/[^C]*; cvs -Q co loncapa; cd loncapa/loncom/build; make build 2>/dev/null; make tardist;`; + +# The real world. Just give them all the gunk for the unstable distribution. +`cd /home/loninst/auto; export CVS_PASSFILE=/home/loninst/.cvspass; export CVSROOT=:pserver:scott\@localhost:/home/cvs; rm -Rf loncapa-unstable; rm -Rf loncapa; cvs -Q export -r HEAD loncapa;`; + +# Generate a README file that advises them about dealing with the gunk. +open(OUT,'>/home/loninst/auto/loncapa/README'); +print(OUT <; +close(IN); # ------------------ Updating the download page with the date of the last build open(IN,"; +my @lines = ; +close(IN); +my $date = `date -I`; chomp($date); +my $text = join('',@lines); +$text =~ s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./; +$text =~ s/LATESTVERSION/$version/g; +$text =~ s/LATESTDATE/$releasedate/g; +open(OUT,">/home/loninst/public_html/docs/downloads/index.html"); +print(OUT $text); +close(OUT); + +#' +# ---------------------------------------- Determine the latest testing version +my $filename=`cd /home/loninst/public_html/versions; find . -type f -name LATEST-TESTING-IS-* -maxdepth 1`; +chomp($filename); +$filename =~ /LATEST-TESTING-IS-(.*)/; +my $version = $1; +open(IN,"; +close(IN); +# -------------- Updating the download page with the date of the last build +open(IN,"; close(IN); -my $date=`date -I`; chomp($date); -my $text=join('',@lines); -$text=~s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./; -$text=~s/loncapa-current\.tar\.gz\<\/a\>.*?\./loncapa-current\.tar\.gz\<\/a\> (version $version)\./; +my $text = join('',@lines); +if ($version) { + $text =~ s/LATESTTESTINGVERSION/$version/g; + $text =~ s/LATESTTESTINGDATE/$releasedate/g; + $text =~ s/TESTINGRELEASE_START//g; + $text =~ s/TESTINGRELEASE_END//g; +} else { + $text =~ s/TESTINGRELEASE_START.*TESTINGRELEASE_END//g; +} open(OUT,">/home/loninst/public_html/docs/downloads/index.html"); print(OUT $text); close(OUT);