@@ -4,71 +4,98 @@ source "scripts/io.sh"
4
4
source " scripts/aws.sh"
5
5
source " scripts/configuration.sh"
6
6
7
- release_name=" rubinius-$( rbx_revision_version) .tar.bz2"
8
-
9
- file_exts=(" " " .md5" " .sha1" " .sha512" )
10
-
11
7
function rbx_url_prefix {
12
8
local bucket=$1
13
9
echo " https://${bucket} .s3-us-west-2.amazonaws.com"
14
10
}
15
11
16
12
function rbx_upload_files {
17
- local bucket file path url name
13
+ local bucket dest src path url name file_exts index
18
14
19
15
bucket=$1
20
- file=$2
21
- path=${3:- }
16
+ dest=$2
17
+ src=$3
18
+ path=${4:- }
22
19
url=$( rbx_url_prefix " $bucket " )
20
+ file_exts=(" " " .md5" " .sha1" " .sha512" )
21
+ index=" index.txt"
23
22
24
- rbx_s3_download " $url " " index.txt "
23
+ rbx_s3_download " $url " " $ index"
25
24
26
25
# Upload all the files first.
27
26
for ext in " ${file_exts[@]} " ; do
28
- rbx_s3_upload " $url " " $bucket " " $file$ext " " $path " || fail " unable to upload file"
27
+ rbx_s3_upload " $url " " $bucket " " $dest$ext " " $src$ext " " $path " ||
28
+ fail " unable to upload file"
29
29
done
30
30
31
31
# Update the index and upload it.
32
32
for ext in " ${file_exts[@]} " ; do
33
33
if [[ -n $path ]]; then
34
- name=" $url$path$file $ext "
34
+ name=" $url$path$dest $ext "
35
35
else
36
- name=" $file $ext "
36
+ name=" $dest $ext "
37
37
fi
38
38
39
- grep " $name " " index.txt "
39
+ grep " $name " " $ index"
40
40
if [ $? -ne 0 ]; then
41
- echo " $name " >> " index.txt "
41
+ echo " $name " >> " $ index"
42
42
fi
43
43
done
44
44
45
- rbx_s3_upload " $url " " $bucket " " index.txt " || fail " unable to upload index"
45
+ rbx_s3_upload " $url " " $bucket " " $ index" " $index " || fail " unable to upload index"
46
46
}
47
47
48
48
# Build and upload the release tarball to S3.
49
49
if [[ $TRAVIS_OS_NAME == osx && $CC == gcc && $RVM == " rbx-2" ]]; then
50
- echo " Deploying release tarball ${release_name} ..."
50
+ echo " Deploying release tarball $( rbx_revision_version ) ..."
51
51
52
52
rake release || fail " unable to build release tarball"
53
53
54
54
bucket=" rubinius-releases-rubinius-com"
55
+ release_name=" rubinius-$( rbx_revision_version) .tar.bz2"
55
56
56
- rbx_upload_files " $bucket " " $release_name "
57
+ rbx_upload_files " $bucket " " $release_name " " $release_name "
57
58
fi
58
59
59
60
# Build and upload a binary to S3.
60
61
if [[ $RVM == " rbx-2" ]]; then
61
- echo " Deploying Travis binary ${release_name} for ${TRAVIS_OS_NAME} ..."
62
+ echo " Deploying Travis binary $( rbx_revision_version ) for ${TRAVIS_OS_NAME} ..."
62
63
63
64
rake package:binary || fail " unable to build binary"
64
65
65
66
bucket=" rubinius-binaries-rubinius-com"
67
+ revision_version=$( rbx_revision_version)
68
+ release_name=" rubinius-$revision_version .tar.bz2"
69
+
70
+ declare -a paths os_releases versions
66
71
67
72
if [[ $TRAVIS_OS_NAME == linux ]]; then
68
- path=" /ubuntu/12.04/x86_64/"
73
+ os_releases=(" 12.04" " 14.04" " 15.10" )
74
+ for (( i= 0 ; i < ${# os_releases[@]} ; i++ )) ; do
75
+ paths[i]=" /ubuntu/${os_releases[i]} /x86_64/"
76
+ done
69
77
else
70
- path=" /osx/10.9/x86_64/"
78
+ os_releases=(" 10.9" " 10.10" " 10.11" )
79
+ for (( i= 0 ; i < ${# os_releases[@]} ; i++ )) ; do
80
+ paths[i]=" /osx/${os_releases[i]} /x86_64/"
81
+ done
71
82
fi
72
83
73
- rbx_upload_files " $bucket " " $release_name " " $path "
84
+ IFS=" ." read -r -a array <<< " $revision_version"
85
+
86
+ let i=0
87
+ version=" "
88
+ versions[i]=" "
89
+
90
+ for v in " ${array[@]} " ; do
91
+ let i=i+1
92
+ versions[i]=" -$version$v "
93
+ version=" $v ."
94
+ done
95
+
96
+ for path in " ${paths[@]} " ; do
97
+ for version in " ${versions[@]} " ; do
98
+ rbx_upload_files " $bucket " " rubinius$version .tar.bz2" " $release_name " " $path "
99
+ done
100
+ done
74
101
fi
0 commit comments