Website now autocleans old files/pages
Hiroki Sato
hrs at FreeBSD.org
Tue Feb 18 21:17:24 UTC 2014
Glen Barber <gjb at freebsd.org> wrote
in <20140218193256.GU1667 at glenbarber.us>:
gj> On Tue, Feb 18, 2014 at 12:36:55PM -0500, Glen Barber wrote:
gj> > On Tue, Feb 18, 2014 at 05:33:53PM +0000, User Www-data wrote:
gj> > > [...]
gj> > >
gj> > > 13.59 real 6.06 user 8.14 sys
gj> > > mkdir: /usr/local/www/www.freebsd.org-clean: Permission denied
gj> > > *** [realinstall] Error code 1
gj> > >
gj> > > Stop in /home/www/build/head/en_US.ISO8859-1/htdocs.
gj> > > 0.03 real 0.00 user 0.02 sys
gj> >
gj> > Whoops.
gj> >
gj> > This is me "fixing" things.
gj> >
gj>
gj> So, what I was working on is making the build clean up after itself, in
gj> particular, things that are no longer part of the build.
gj>
gj> DESTDIR has changed, and is purged before every build (even the "quick"
gj> incremental builds). Once the build finishes, the files are installed
gj> to the new DESTDIR, then synced to the public web root.
gj>
gj> When a full site refresh is done (once a week, as was done before),
gj> rsync is called with '--delete', so anything removed from the DESTDIR
gj> will be purged from the public web root.
Hmm, replacing www/www.freebsd.org with a symlink might be simpler
than copying files in DESTDIR into PUBDIR and removing DESTDIR
everytime. Create a staging directory and set DESTDIR to it, do make
install as before, and make the symlink to point the DESTDIR as a
newly-built document set (and removing the old directory). It does
not need copying files and the contents can be switched atomically.
Just my $0.02.
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20140219/dd233976/attachment.sig>
More information about the freebsd-doc
mailing list