source: trunk/base/portmgr/jobs/GuideRegen.sh @ 30447

Last change on this file since 30447 was 30447, checked in by jmpp@…, 12 years ago

Move all server side jobs to a new portmgr/jobs dir, in order to keep easier track of what we need to setup to have all our services running.
Add placeholder launchd plists for those jobs that don't already have an uploaded one (all but PortIndex2MySQL); I hope to fill these with
the appropriate information as I gather it.

PS: James, do you want me to move autosubmit in here too?

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-sh
File size: 2.1 KB
Line 
1#!/bin/bash
2
3####
4# Guide regen automation script.
5# Created by Daniel J. Luke
6# e-mail: dluke@geeklair.net
7# Based on IndexRegen.sh
8# $Id: GuideRegen.sh 30447 2007-10-28 05:58:31Z jmpp@macports.org $
9####
10
11# Configuration
12LOCKFILE=/tmp/.mp_svn_guide_regen.lock
13# ROOT directory, where everything is. This needs to exist!
14ROOT=/Users/mp-user/mp_svn_guide_regen
15# MP user.
16MP_USER=mp-user
17# MP group.
18MP_GROUP=mp-user
19# e-mail address to spam in case of failure.
20SPAM_LOVERS=macports-dev@lists.macosforge.org,dluke@geeklair.net,markd@macports.org
21
22# Other settings (probably don't need to be changed).
23SVN_CONFIG_DIR=${ROOT}/svnconfig
24REPO_BASE=http://svn.macports.org/repository/macports
25SVN="/opt/local/bin/svn -q --non-interactive --config-dir $SVN_CONFIG_DIR"
26# Where to checkout the source code. This needs to exist!
27SRCTREE=${ROOT}/source
28# Where MP will install its world. This gets created.
29PREFIX=/opt/local
30# Path.
31PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
32# Log for the e-mail in case of failure.
33FAILURE_LOG=${ROOT}/guide_failure.log
34# The date.
35DATE=$(date +'%A %Y-%m-%d at %H:%M:%S')
36
37
38# Function to spam people in charge if something goes wrong during guide regen.
39bail () {
40    mail -s "Guide Regen Failure on ${DATE}" $SPAM_LOVERS < $FAILURE_LOG
41    cleanup; exit 1
42}
43
44# Cleanup fuction for runtime files.
45cleanup () {
46    rm -f $FAILURE_LOG $LOCKFILE
47}
48
49
50if [ ! -e $LOCKFILE ]; then
51    touch $LOCKFILE
52else
53    echo "Guide Regen lockfile found, is another regen job running?"
54    exit 1
55fi
56
57# Checkout/update the doc tree
58if [ -d ${SRCTREE}/doc-new ]; then
59    $SVN update ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
60        || { echo "Updating the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
61else
62    $SVN checkout ${REPO_BASE}/trunk/doc-new ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
63        || { echo "Checking out the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
64fi
65
66# (re)build
67{ cd ${SRCTREE}/doc-new && make guide > $FAILURE_LOG 2>&1 ; } \
68    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
69
70# At this point the guide was regen'd successfuly, so we cleanup before we exit.
71cleanup && exit 0
Note: See TracBrowser for help on using the repository browser.