File:  [LON-CAPA] / loncom / build / install_web_site_cronjob
Revision 1.3: download - view: text, annotated - select for diffs
Thu Sep 12 20:40:30 2002 UTC (21 years, 9 months ago) by albertel
Branches: MAIN
CVS tags: version_0_6_2, version_0_6, HEAD
- changing how and where it gets the current version number
- changing what is in the unstable tarball, It is now more inclusive of files

    1: #!/usr/bin/perl
    2: 
    3: =pod
    4: 
    5: =head1 NAME
    6: 
    7: install_web_site_cronjob - maintain install.lon-capa.org web-site every day
    8: 
    9: =head1 DESCRIPTION
   10: 
   11: This is a file that runs periodically on B<install.lon-capa.org>.
   12: 
   13: This file should be run by the 'loninst' user and be part of
   14: the 'loninst' crontab entries (to view loninst crontab, login
   15: as loninst and crontab C<-l>; to edit loninst crontab, login as
   16: loninst and crontab C<-e>).
   17: 
   18: This file should be on the B<install.lon-capa.org> filesystem as
   19: F</home/loninst/auto/install_web_site_cronjob>.
   20: 
   21: The current 'loninst' crontab entry is:
   22: 
   23: 13 16 * * *    /home/loninst/auto/install_web_site_cronjob
   24: 
   25: The main goal of B<install_web_site_cronjob> is to periodically produce the
   26: unstable tarball needed for LON-CAPA installation.
   27: 
   28: A secondary yet important function of B<install_web_site_cronjob> is that it
   29: also refreshes the documentation present on the install.lon-capa.org
   30: web site.
   31: 
   32: It does depend on a file name LATEST-IS-something, where something is
   33: the latest release of loncapa, that file should also contain a string
   34: that will be used to date the release.
   35: 
   36: The coding of this script is a strange brew of shell commands
   37: with perl.
   38: 
   39: =head1 AUTHOR
   40: 
   41: Scott Harrison 2002-07-19
   42: 
   43: =cut
   44: 
   45: # --------------------------------------------- Making the tarball distribution
   46: #`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;`;
   47: `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; ln -s loncapa loncapa-unstable; tar cvvf loncapa-unstable.tar loncapa-unstable/* ;gzip -9 -f loncapa-unstable.tar`;
   48: # ---------------------------------------- Dynamically generating documentation
   49: `cd /home/loninst/auto/loncapa/loncom/build; make pdfdoc`;
   50: `cd /home/loninst/auto/loncapa/loncom/build; make doc`;
   51: `cd /home/loninst/auto/loncapa/loncom/build; cp docs.tar.gz /home/loninst/public_html/docs/.`;
   52: `cd /home/loninst/public_html/docs; tar xzf docs.tar.gz`;
   53: 
   54: # ------------------------------------ Copying over the latest unstable tarball
   55: #my $filename=`cd /home/loninst/auto; find loncapa -type f -name *.tar.gz -maxdepth 1`;
   56: #chomp($filename);
   57: #$filename=~/loncapa\/loncapa\-(.*?)\.tar\.gz/;
   58: #my $version=$1;
   59: `cd /home/loninst/auto; cp -f loncapa-unstable.tar.gz ../public_html/versions/loncapa-unstable.tar.gz`;
   60: #`cd /home/loninst/public_html/versions; rm -f loncapa-unstable.tar.gz; ln -s loncapa-$version-unstable.tar.gz loncapa-unstable.tar.gz`;
   61: 
   62: #get latest version
   63: my $filename=`cd /home/loninst/public_html/versions; find . -type f -name LATEST-IS-* -maxdepth 1`;
   64: chomp($filename);
   65: $filename=~/LATEST-IS-(.*)/;
   66: my $version=$1;
   67: open(IN,"</home/loninst/public_html/versions/$filename");
   68: my $releasedate=<IN>;
   69: close(IN);
   70: # ------------------ Updating the download page with the date of the last build
   71: open(IN,"</home/loninst/public_html/docs/downloads/index.html");
   72: my @lines=<IN>;
   73: close(IN);
   74: my $date=`date -I`; chomp($date);
   75: my $text=join('',@lines);
   76: $text=~s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./;
   77: $text=~s/LATESTVERSION/$version/g;
   78: $text=~s/LATESTDATE/$releasedate/g;
   79: open(OUT,">/home/loninst/public_html/docs/downloads/index.html");
   80: print(OUT $text);
   81: close(OUT);

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