]>
Commit | Line | Data |
---|---|---|
d128f8ab | 1 | #!/bin/sh -e |
9c1550be | 2 | echo "RUN: $0" |
16760e84 | 3 | # Nightly cron job to generate snapshot releases |
c79c8240 | 4 | top=${PWD} |
3e16d6e1 | 5 | versions=/server/httpd/htdocs/squid-cache.org/content/Versions/ |
c79c8240 | 6 | TMPDIR=/home/squidadm/${LOGNAME}.cron |
16760e84 | 7 | export TMPDIR |
c79c8240 AJ |
8 | if [ -d ${TMPDIR} ]; then |
9 | chmod -R +w ${TMPDIR} | |
10 | rm -rf ${TMPDIR} | |
16760e84 | 11 | fi |
c79c8240 | 12 | mkdir -p ${TMPDIR} |
9c1550be | 13 | trap "echo FAIL-BUILD_snapshot-cron; cd /; chmod -R +w ${TMPDIR}; rm -rf ${TMPDIR}" 0 |
16760e84 | 14 | |
73bf367e | 15 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin |
16760e84 | 16 | export PATH |
17 | ||
18 | # Be nice to our friends. This is a batch job | |
19 | renice 10 $$ >/dev/null | |
20 | ||
21 | make_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 | |
74243da8 | 61 | set +e |
16760e84 | 62 | # cleanup old snapshots |
ed9c16d2 | 63 | ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \ |
5f3f8b3f | 64 | # sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \ |
ed9c16d2 AJ |
65 | sort -r | tail +${save} | \ |
66 | while read f; do | |
5f3f8b3f | 67 | rm -f ${f} ${f}.md5 |
b8801977 | 68 | done |
74243da8 A |
69 | set -e |
70 | ||
3cdf47ea AJ |
71 | # update dynamic index pages Last-Modified info |
72 | touch ${dst}/index.dyn | |
73 | ||
4b475dd4 | 74 | # Special cases |
c79c8240 | 75 | case ${file} in |
4b475dd4 | 76 | *-cfgman.tar.gz) |
c79c8240 AJ |
77 | mkdir -p ${dst}/cfgman |
78 | tar -C ${dst}/cfgman -zxf ${dst}/${file} | |
4b475dd4 | 79 | ;; |
47eac8b8 | 80 | *-cfgman.html) |
c79c8240 AJ |
81 | rm -f ${dst}/cfgman.html |
82 | ln -s ${dst}/${file} ${dst}/cfgman.html | |
47eac8b8 | 83 | ;; |
84 | *-cfgman.html.gz) | |
c79c8240 AJ |
85 | rm -f ${dst}/cfgman.html.gz |
86 | ln -s ${dst}/${file} ${dst}/cfgman.html.gz | |
47eac8b8 | 87 | ;; |
12175206 | 88 | *-manuals.tar.gz) |
c79c8240 AJ |
89 | mkdir -p ${dst}/manuals |
90 | tar -C ${dst}/manuals -zxf ${dst}/${file} | |
12175206 | 91 | ;; |
4b475dd4 | 92 | esac |
16760e84 | 93 | done |
16760e84 | 94 | } } |
95 | ||
96 | set +e | |
97 | ||
7a4766c6 HN |
98 | # autotool derived files not kept in trunk, but still need to bootstrap for make dist |
99 | ../commit/bootstrap squid-3 | |
3e16d6e1 | 100 | make_snapshot ../commit/squid-3/mksnapshot.sh trunk v3 3.HEAD 6 |
16760e84 | 101 | |
2accec88 | 102 | rm -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
720e7b9c | 103 | cp ../commit/squid-3/CONTRIBUTORS /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
2accec88 | 104 | chmod 444 /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new |
3e16d6e1 | 105 | mv -f /server/httpd/htdocs/squid-cache.org/CONTRIBUTORS.new /server/httpd/htdocs/squid-cache.org/content/CONTRIBUTORS.txt |
2accec88 | 106 | |
107 | rm -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new | |
720e7b9c | 108 | cp ../commit/squid-3/SPONSORS /server/httpd/htdocs/squid-cache.org/SPONSORS.new |
2accec88 | 109 | chmod 444 /server/httpd/htdocs/squid-cache.org/SPONSORS.new |
3e16d6e1 | 110 | mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt |
7ecf1a1c | 111 | |
d3e0e2f9 A |
112 | ../commit/bootstrap squid-3.3 |
113 | make_snapshot ../commit/squid-3/mksnapshot.sh 3.3 v3 3.3 30 | |
114 | ||
ddaf63b1 | 115 | ../commit/bootstrap squid-3.2 |
ed9c16d2 | 116 | make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30 |
ddaf63b1 | 117 | |
037ade45 | 118 | ../commit/bootstrap squid-3.1 |
ed9c16d2 | 119 | make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30 |
037ade45 | 120 | |
97f546d1 AJ |
121 | #../commit/bootstrap squid-3.0 |
122 | #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3 | |
16760e84 | 123 | |
029ef05a AJ |
124 | #../commit/bootstrap squid-2 |
125 | #make_snapshot ../commit/squid-2/mksnapshot.sh HEAD v2 HEAD 3 | |
33835f37 | 126 | |
029ef05a AJ |
127 | #../commit/bootstrap squid-2.7 |
128 | #make_snapshot ../commit/squid-2.7/mksnapshot.sh SQUID_2_7 v2 2.7 3 | |
f1a01511 | 129 | |
0e8cd610 HN |
130 | #../commit/bootstrap squid-2.6 |
131 | #make_snapshot ../commit/squid-2.6/mksnapshot.sh SQUID_2_6 v2 2.6 3 | |
16760e84 | 132 | |
031dffde | 133 | #../commit/bootstrap squid-2.5 |
134 | #make_snapshot ../commit/squid-2.5/mksnapshot.sh SQUID_2_5 v2 2.5 3 | |
16760e84 | 135 | |
136 | #../commit/squid3-SQUID2.sync |