File:
[LON-CAPA] /
loncom /
build /
install_web_site_cronjob
Revision
1.11:
download - view:
text,
annotated -
select for diffs
Sat Jan 28 23:16:27 2012 UTC (12 years, 6 months ago) by
raeburn
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
HEAD
- Adding $Id$ to show version.
- Building cvs repo uses checkout instead of export, so CVS/Entries will be
available to prevent generation of unwanted .lpmlsave files when updating.
- Include part of modules/TexConvert (compiles, cmmands tth.so and tth.pm)
to prevent WARNINGS when creating tardist.
- Update README.
1: #!/usr/bin/perl
2:
3: # $Id: install_web_site_cronjob,v 1.11 2012/01/28 23:16:27 raeburn Exp $
4:
5: =pod
6:
7: =head1 NAME
8:
9: install_web_site_cronjob - maintain install.lon-capa.org web-site every day
10:
11: =head1 DESCRIPTION
12:
13: This is a file that runs periodically on B<install.lon-capa.org>.
14:
15: This file should be run by the 'loninst' user and be part of
16: the 'loninst' crontab entries (to view loninst crontab, login
17: as loninst and crontab C<-l>; to edit loninst crontab, login as
18: loninst and crontab C<-e>).
19:
20: This file should be on the B<install.lon-capa.org> filesystem as
21: F</home/loninst/auto/install_web_site_cronjob>.
22:
23: The current 'loninst' crontab entry is:
24:
25: 13 16 * * * /home/loninst/auto/install_web_site_cronjob
26:
27: The main goal of B<install_web_site_cronjob> is to periodically produce the
28: unstable tarball needed for LON-CAPA installation.
29:
30: A secondary yet important function of B<install_web_site_cronjob> is that it
31: also refreshes the documentation present on the install.lon-capa.org
32: web site.
33:
34: This documentation is refreshed based on a file located inside
35: F</home/loninst/public_html/versions>. This file is named
36: F<LATEST-IS-VERSIONNUMBER>, where
37: I<VERSIONNUMBER> is the latest stable release of loncapa (e.g. 0.4 or 0.6.1).
38: The F<LATEST-IS-VERSIONNUMBER> file contains a string
39: that is used to date the release of the current stable version.
40:
41: The coding of this script is a strange brew of shell commands
42: with perl.
43:
44: =head1 AUTHOR
45:
46:
47: =cut
48:
49: # --------------------------------------------- Making the tarball distribution
50:
51: # In an ideal world, this tarball distribution would be always generated with
52: # the "make tardist" command. But instead, unstable is now defined as
53: # "all the gunk we have been working on", whereas the
54: # "make tardist" command means a "carefully inventoried selection of gunk".
55: #`cd /home/loninst/auto; export CVS_RSH=ssh; export CVSROOT=:ext:loninst\@source.lon-capa.org:/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;`;
56:
57: # The real world. Just give them all the gunk for the unstable distribution.
58: `cd /home/loninst/auto; export CVS_RSH=ssh; export CVSROOT=:ext:loninst\@source.lon-capa.org:/home/cvs; rm -Rf loncapa-unstable; rm -Rf loncapa; cvs -Q co -r HEAD loncapa; cd /home/loninst/auto/loncapa; cvs -Q co -r HEAD modules/TexConvert/tthperl/compiles; cvs -Q co -r HEAD modules/TexConvert/tthperl/commands; cp -p loncom/xml/tth.pm modules/TexConvert/tthperl/tth.pm; `;
59:
60: # Generate a README file that advises them about dealing with the gunk.
61: open(OUT,'>/home/loninst/auto/loncapa/README');
62: print(OUT <<END);
63: This is a CVS export of LON-CAPA generated on:
64: END
65: print(OUT `date`);
66: print(OUT <<END);
67:
68: To generate an installable tarball distribution from this file, you can
69: execute the following commands:
70: cd loncom/build
71: make build
72: make tardist
73:
74: Note that the installable tarball distribution (the 'tardist' target)
75: is what encapsulates the stable releases of the LON-CAPA software (as
76: well as ensuring that LON-CAPA's distributability does not rely solely on
77: CVS software).
78:
79: END
80: print(OUT <<END);
81: An alternative Makefile command sequence is:
82: cd loncom/build
83: make build
84: make install
85:
86: In this case you will be need to create symbolic links for the following
87: in loncom (unless you have done this previously):
88:
89: hosts.tab
90: domain.tab
91: dns_hosts.tab
92: dns_domain.tab
93:
94: which will point at development_hosts.tab, development_domain.tab,
95: development_dns_hosts.tab, and development_dns_domain.tab respectively
96: in loncom.
97:
98: For more information on Makefile targets, you can just enter the following
99: commands:
100: cd loncom/build
101: make help
102:
103: Finally, if you encounter any problems, be sure to enter them
104: into the bug database http://bugs.lon-capa.org/ or, alternatively,
105: discuss them on one of the mailing lists available at
106: http://mail.lon-capa.org/.
107: END
108: close(OUT);
109:
110: #'
111: # Roll the directory together into the unstable tarball.
112: `cd /home/loninst/auto; ln -s loncapa loncapa-unstable; tar cvvf loncapa-unstable.tar loncapa-unstable/* ;gzip -9 -f loncapa-unstable.tar`;
113:
114: # ---------------------------------------- Dynamically generating documentation
115:
116: system("rm /home/loninst/public_html/*html");
117:
118: # pdf and doc targets are borken right now
119: #`cd /home/loninst/auto/loncapa/loncom/build; make pdfdoc`;
120: #`cd /home/loninst/auto/loncapa/loncom/build; make doc`;
121: #`cd /home/loninst/auto/loncapa/loncom/build; cp docs.tar.gz /home/loninst/public_html/docs/.`;
122: #`cd /home/loninst/public_html/docs; tar xzf docs.tar.gz`;
123:
124: `cd /home/loninst/auto/loncapa/loncom/build; make buildwebsite`;
125: system("cp /home/loninst/auto/loncapa/doc/build/*.html /home/loninst/public_html/");
126:
127: # ------------------------------------ Copying over the latest unstable tarball
128: #my $filename=`cd /home/loninst/auto; find loncapa -type f -name *.tar.gz -maxdepth 1`;
129: #chomp($filename);
130: #$filename=~/loncapa\/loncapa\-(.*?)\.tar\.gz/;
131: #my $version=$1;
132: `cd /home/loninst/auto; cp -f loncapa-unstable.tar.gz ../public_html/versions/loncapa-unstable.tar.gz`;
133: #`cd /home/loninst/public_html/versions; rm -f loncapa-unstable.tar.gz; ln -s loncapa-$version-unstable.tar.gz loncapa-unstable.tar.gz`;
134:
135: # ------------------------------------------------ Determine the latest version
136: my $filename=`cd /home/loninst/public_html/versions; find . -type f -name LATEST-IS-* -maxdepth 1`;
137: chomp($filename);
138: $filename =~ /LATEST-IS-(.*)/;
139: my $version = $1;
140: open(IN,"</home/loninst/public_html/versions/$filename");
141: my $releasedate = <IN>;
142: close(IN);
143:
144: # ------------------ Updating the download page with the date of the last build
145: open(IN,"</home/loninst/public_html/index.html");
146: my @lines = <IN>;
147: close(IN);
148: my $date = `date -I`; chomp($date);
149: my $text = join('',@lines);
150: $text =~ s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./;
151: $text =~ s/LATESTVERSION/$version/g;
152: $text =~ s/LATESTDATE/$releasedate/g;
153: open(OUT,">/home/loninst/public_html/index.html");
154: print(OUT $text);
155: close(OUT);
156:
157: #'
158: # ---------------------------------------- Determine the latest testing version
159: my $filename=`cd /home/loninst/public_html/versions; find . -type f -name LATEST-TESTING-IS-* -maxdepth 1`;
160: chomp($filename);
161: $filename =~ /LATEST-TESTING-IS-(.*)/;
162: my $version = $1;
163: open(IN,"</home/loninst/public_html/versions/$filename");
164: my $releasedate = <IN>;
165: close(IN);
166: # -------------- Updating the download page with the date of the last build
167: open(IN,"</home/loninst/public_html/index.html");
168: my @lines = <IN>;
169: close(IN);
170: my $text = join('',@lines);
171: if ($version) {
172: $text =~ s/LATESTTESTINGVERSION/$version/g;
173: $text =~ s/LATESTTESTINGDATE/$releasedate/g;
174: $text =~ s/TESTINGRELEASE_START//g;
175: $text =~ s/TESTINGRELEASE_END//g;
176: } else {
177: $text =~ s/TESTINGRELEASE_START.*TESTINGRELEASE_END//gs;
178: }
179: open(OUT,">/home/loninst/public_html/index.html");
180: print(OUT $text);
181: close(OUT);
182:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>