~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/publishing/cron.daily

  • Committer: Daniel Silverstone
  • Date: 2006-01-24 19:32:56 UTC
  • mto: (3023.2.4 uploader-tests)
  • mto: This revision was merged to the branch mainline in revision 3283.
  • Revision ID: daniel.silverstone@canonical.com-20060124193256-870fa2a24c32fc44
Make publish-distro.py executable and add shiny new cron.daily

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Launchpad cron.daily (currently just for Ubuntu)
 
4
 
 
5
# Informational -- this *MUST* match the database
 
6
ARCHIVEROOT=/srv/launchpad.net/ubuntu-archive/ubuntu
 
7
DISTSROOT=$ARCHIVEROOT/dists
 
8
OVERRIDEROOT=$ARCHIVEROOT/../ubuntu-overrides
 
9
INDICES=$ARCHIVEROOT/indices
 
10
 
 
11
# Configuration options
 
12
LPCONFIG=staging
 
13
LAUNCHPADROOT=/srv/launchpad.net/codelines/current
 
14
LOCKFILE=/srv/launchpad.net/cron.daily.lock
 
15
DISTRONAME=ubuntu
 
16
GNUPGHOME=/srv/launchpad.net/ubuntu-archive/gnupg-home
 
17
TOUCHLIST=$ARCHIVEROOT/project/trace/$(hostname --fqdn)
 
18
 
 
19
# Manipulate the environment
 
20
export LPCONFIG
 
21
export GNUPGHOME
 
22
PATH=$PATH:$LAUNCHPADROOT/scripts:$LAUNCHPADROOT/cronscripts
 
23
 
 
24
# claim the lock
 
25
 
 
26
if ! lockfile -r1 $LOCKFILE; then
 
27
  echo "Could not claim lock file."
 
28
  exit 1
 
29
fi
 
30
 
 
31
cleanup () {
 
32
  echo "Cleaning up lockfile."
 
33
  rm -f $LOCKFILE
 
34
}
 
35
 
 
36
trap cleanup 0
 
37
 
 
38
# Lock claimed.
 
39
 
 
40
# Process the accepted queue into the publishing records.
 
41
process-accepted.py $DISTRONAME
 
42
 
 
43
# Publish the results.
 
44
publish-distro.py -d $DISTRONAME
 
45
 
 
46
# Find all the Release files for which the Release.GPG is missing/too-old
 
47
for RELEASEFILE in $(find $DISTSROOT -name Release); do
 
48
  #  [ Release.gpg missing   ] or [ Release is newer than Release.gpg ]
 
49
  if [ ! -f $RELEASEFILE.gpg ] || [ $RELEASEFILE -nt $RELEASEFILE.gpg ]; then
 
50
    gpg --detach-sign --armor -o $RELEASEFILE.gpg --sign $RELEASEFILE
 
51
  fi
 
52
done
 
53
 
 
54
# Copy in the indices
 
55
rm $INDICES/*
 
56
cp $OVERRIDEROOT/override.* $INDICES
 
57
 
 
58
# Touch everything you asked us to do
 
59
for FILE in $TOUCHLIST; do
 
60
  touch "$FILE"
 
61
done