File:  [LON-CAPA] / loncom / build / install_web_site_cronjob
Revision 1.1: download - view: text, annotated - select for diffs
Fri Jul 19 19:53:34 2002 UTC (21 years, 9 months ago) by harris41
Branches: MAIN
CVS tags: version_0_5_1, version_0_5, HEAD
a script that is run every day on install.lon-capa.org (it has been running
for the last several months, but figured I would make it official)

#!/usr/bin/perl

=pod

=head1 NAME

install_web_site_cronjob - maintain install.lon-capa.org web-site every day

=head1 DESCRIPTION

This is a file that runs periodically on B<install.lon-capa.org>.

This file should be run by the 'loninst' user and be part of
the 'loninst' crontab entries (to view loninst crontab, login
as loninst and crontab C<-l>; to edit loninst crontab, login as
loninst and crontab C<-e>).

This file should be on the B<install.lon-capa.org> filesystem as
F</home/loninst/auto/autotardist>.

The current 'loninst' crontab entry is:

13 16 * * *    /home/loninst/auto/autotardist

The main goal of B<autotardist> is to periodically produce the
tarball needed for LON-CAPA installation.

A secondary yet important function of B<autotardist> is that it
also refreshes the documentation present on the install.lon-capa.org
web site.

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;`;

# ---------------------------------------- Dynamically generating documentation
`cd /home/loninst/auto/loncapa/loncom/build; make pdfdoc`;
`cd /home/loninst/auto/loncapa/loncom/build; make doc`;
`cd /home/loninst/auto/loncapa/loncom/build; cp docs.tar.gz /home/loninst/public_html/docs/.`;
`cd /home/loninst/public_html/docs; tar xzf docs.tar.gz`;

# ------------------------------------ Copying over the latest unstable tarball
my $filename=`cd /home/loninst/auto; find loncapa -type f -name *.tar.gz -maxdepth 1`;
chomp($filename);
$filename=~/loncapa\/loncapa\-(.*?)\.tar\.gz/;
my $version=$1;
`cd /home/loninst/auto; cp -f loncapa/loncapa-$version.tar.gz ../public_html/versions/loncapa-$version-unstable.tar.gz`;
`cd /home/loninst/public_html/versions; rm -f loncapa-unstable.tar.gz; ln -s loncapa-$version-unstable.tar.gz loncapa-unstable.tar.gz`;

# ------------------ Updating the download page with the date of the last build
open(IN,"</home/loninst/public_html/docs/downloads/index.html");
my @lines=<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)\./;
open(OUT,">/home/loninst/public_html/docs/downloads/index.html");
print(OUT $text);
close(OUT);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>