]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot-cron.sh
SourceFormat Enforcement
[thirdparty/squid.git] / mksnapshot-cron.sh
CommitLineData
d128f8ab 1#!/bin/sh -e
9c1550be 2echo "RUN: $0"
16760e84 3# Nightly cron job to generate snapshot releases
c79c8240 4top=${PWD}
3e16d6e1 5versions=/server/httpd/htdocs/squid-cache.org/content/Versions/
c79c8240 6TMPDIR=/home/squidadm/${LOGNAME}.cron
16760e84 7export TMPDIR
c79c8240
AJ
8if [ -d ${TMPDIR} ]; then
9 chmod -R +w ${TMPDIR}
10 rm -rf ${TMPDIR}
16760e84 11fi
c79c8240 12mkdir -p ${TMPDIR}
9c1550be 13trap "echo FAIL-BUILD_snapshot-cron; cd /; chmod -R +w ${TMPDIR}; rm -rf ${TMPDIR}" 0
16760e84 14
73bf367e 15PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
16760e84 16export PATH
17
18# Be nice to our friends. This is a batch job
19renice 10 $$ >/dev/null
20
21make_snapshot()
22{ {
23 set -e
24 cd ../release
c79c8240
AJ
25 mksnap=${1}
26 branch=${2}
27 dir=${3}
28 ver=${4}
16760e84 29 save=${5:-3}
c79c8240 30 dst=${versions}/${dir}/${ver}
eff68534 31 out=${6:-`basename $branch`}
c79c8240
AJ
32 $mksnap ${branch} ${6} 2>&1 | grep -v "set owner/group"
33 for file in `cat ${out}.out` ; do
34 case ${file} in
28a28b8e 35 *-cfgman.tar.gz)
36 type=-cfgman.tar.gz
37 ;;
b3b99536
AJ
38 *-langpack.tar.gz)
39 type=-langpack.tar.gz
40 ;;
12175206
AJ
41 *-manuals.tar.gz)
42 type=-manuals.tar.gz
43 ;;
28a28b8e 44 *)
c79c8240 45 type=`echo ${file} | sed -e 's/.*\.tar\.gz/.tar.gz/' -e 's/.*\.tar\.bz2/.tar.bz2/' -e 's/.*\.patch/.patch/' -e 's/.*\.diff/.diff/' -e 's/.*-RELEASENOTES.html/-RELEASENOTES.html/' -e 's/^.*ChangeLog.txt$/-ChangeLog.txt/' -e 's/.*-cfgman/-cfgman/'`
28a28b8e 46 esac
16760e84 47
48 # move tarball
c79c8240
AJ
49 rm -f ${dst}/${file}.md5
50 rm -f ${dst}/${file}
51 md5 ${file} >${dst}/${file}.md5
52 cp -p ${file} ${dst}/${file}
53 rm -f ${file}
16760e84 54
55 # update snapshot symlink
c79c8240
AJ
56 rm -f ${dst}/squid-${ver}.snapshot$type
57 ln -s ${file} ${dst}/squid-${ver}.snapshot${type}
58 rm -f ${dst}/squid-${ver}.snapshot${type}.md5
59 ln -s ${file}.md5 ${dst}/squid-${ver}.snapshot${type}.md5
16760e84 60
61 # cleanup old snapshots
c79c8240
AJ
62 ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]${type} | sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'${type}'\)/\1/' | sort -r | tail +${save} | while read f; do
63 rm -f ${dst}/*-${f} ${dst}/*-${f}.md5
b8801977 64 done
4b475dd4 65
66 # Special cases
c79c8240 67 case ${file} in
4b475dd4 68 *-cfgman.tar.gz)
c79c8240
AJ
69 mkdir -p ${dst}/cfgman
70 tar -C ${dst}/cfgman -zxf ${dst}/${file}
4b475dd4 71 ;;
47eac8b8 72 *-cfgman.html)
c79c8240
AJ
73 rm -f ${dst}/cfgman.html
74 ln -s ${dst}/${file} ${dst}/cfgman.html
47eac8b8 75 ;;
76 *-cfgman.html.gz)
c79c8240
AJ
77 rm -f ${dst}/cfgman.html.gz
78 ln -s ${dst}/${file} ${dst}/cfgman.html.gz
47eac8b8 79 ;;
12175206 80 *-manuals.tar.gz)
c79c8240
AJ
81 mkdir -p ${dst}/manuals
82 tar -C ${dst}/manuals -zxf ${dst}/${file}
12175206 83 ;;
4b475dd4 84 esac
16760e84 85 done
16760e84 86} }
87
88set +e
89
7a4766c6
HN
90# autotool derived files not kept in trunk, but still need to bootstrap for make dist
91../commit/bootstrap squid-3
3e16d6e1 92make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6
16760e84 93
2accec88 94rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
720e7b9c 95cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
2accec88 96chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new
3e16d6e1 97mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt
2accec88 98
99rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new
720e7b9c 100cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new
2accec88 101chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new
3e16d6e1 102mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt
7ecf1a1c 103
ddaf63b1
A
104../commit/bootstrap squid-3.2
105make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 5
106
037ade45
AJ
107../commit/bootstrap squid-3.1
108make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 3
109
97f546d1
AJ
110#../commit/bootstrap squid-3.0
111#make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3
16760e84 112
029ef05a
AJ
113#../commit/bootstrap squid-2
114#make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3
33835f37 115
029ef05a
AJ
116#../commit/bootstrap squid-2.7
117#make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3
f1a01511 118
0e8cd610
HN
119#../commit/bootstrap squid-2.6
120#make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3
16760e84 121
031dffde 122#../commit/bootstrap squid-2.5
123#make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3
16760e84 124
125#../commit/squid3-SQUID2.sync