Changelog update.
[debian_buildbot.git] / common / gcode-upload.sh
blobf5f3ebc63ba62cf1a93b69d3927687dd82be3d89
1 #! /bin/sh
3 usage='USAGE: gcode-upload.sh VERSION USERNAME GCODE-PASSWORD
5 The gcode password is available from http://code.google.com/hosting/settings;
6 it is *not* your google account password.
9 if test $# != 3; then
10 echo "$usage"
11 exit 1
14 if test ! -f common/googlecode_upload.py; then
15 echo "download googlecode_upload.py from"
16 echo " http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py"
17 echo "and place it in common/"
18 exit 1
21 VERSION="$1"
22 USERNAME="$2"
23 PASSWORD="$3"
25 findfile() {
26 local file="$1"
27 test -f "dist/$file" && echo "dist/$file"
28 test -f "master/dist/$file" && echo "master/dist/$file"
29 test -f "slave/dist/$file" && echo "slave/dist/$file"
30 test -f "$file" && echo "$file"
33 findlabels() {
34 local file="$1"
35 local labels=Featured
36 if test "`echo $file | sed 's/.*\.asc/Signature/'`" = "Signature"; then
37 labels="$labels,Signature"
39 if test "`echo $file | sed 's/.*\.tar.gz.*/Tar/'`" = "Tar"; then
40 labels="$labels,OpSys-POSIX"
41 else
42 labels="$labels,OpSys-Win"
44 echo $labels
47 i=0
48 for file in {buildbot,buildbot-slave}-$VERSION.{tar.gz,zip}{,.asc}; do
49 if test $i = 0; then
50 i=1
51 continue
53 labels=`findlabels "$file"`
54 file=`findfile "$file"`
55 echo "Uploading $file with labels $labels"
56 python common/googlecode_upload.py \
57 -w $PASSWORD \
58 -u $USERNAME \
59 -p buildbot \
60 -s "$file" \
61 --labels=Featured \
62 "$file"
63 done