|
1 |
| -require 'aws-sdk' |
2 |
| -require 'pathname' |
3 |
| - |
4 | 1 | desc "Deploy a Rubinius release"
|
5 | 2 | task :deploy do
|
6 |
| - s3 = Aws::S3::Client.new(region: "us-west-2") |
7 |
| - file_exts = ["", ".md5", ".sha1", ".sha512"] |
8 |
| - |
9 |
| - # TODO: extract the name to a method |
10 |
| - basename = "rubinius-#{rbx_version}.tar.bz2" |
11 |
| - |
12 |
| - # Build and upload the release tarball to S3. |
13 |
| - if ENV["TRAVIS_OS_NAME"] == "linux" and ENV["CC"] == "clang" and ENV["RVM"] == "rbx-2" |
14 |
| - puts "Deploying release tarball #{basename}..." |
15 |
| - |
16 |
| - Rake::Task['release'].invoke |
17 |
| - |
18 |
| - bucket = "rubinius-releases-rubinius-com" |
19 |
| - |
20 |
| - index = "index.txt" |
21 |
| - index_list = s3.get_object(bucket: bucket, key: index).body.read |
22 |
| - |
23 |
| - file_exts.each do |ext| |
24 |
| - name = basename + ext |
25 |
| - s3.put_object bucket: bucket, key: name, body: File.read(name) |
26 |
| - |
27 |
| - index_list << name << "\n" unless index_list =~ /#{name}/ |
28 |
| - end |
29 |
| - |
30 |
| - s3.put_object bucket: bucket, key: index, body: index_list |
31 |
| - end |
32 |
| - |
33 |
| - # Build and upload a binary to S3. |
34 |
| - if ENV["RVM"] == "rbx-2" |
35 |
| - puts "Deploying Travis binary #{basename}..." |
36 |
| - |
37 |
| - Rake::Task['package:binary'].invoke |
38 |
| - |
39 |
| - url_prefix = "https://rubinius-binaries-rubinius-com.s3-us-west-2.amazonaws.com/" |
40 |
| - bucket = "rubinius-binaries-rubinius-com" |
41 |
| - |
42 |
| - if ENV["TRAVIS_OS_NAME"] == "linux" |
43 |
| - path_prefix = "ubuntu/12.04/x86_64/" |
44 |
| - else |
45 |
| - path_prefix = "osx/10.9/x86_64/" |
46 |
| - end |
47 |
| - |
48 |
| - index_list = s3.get_object(bucket: bucket, key: index).body.read |
49 |
| - |
50 |
| - file_exts.each do |ext| |
51 |
| - name = basename + ext |
52 |
| - key = path_prefix + name |
53 |
| - s3.put_object bucket: bucket, key: key, body: File.read(name) |
54 |
| - |
55 |
| - path = url_prefix + key |
56 |
| - index_list << path << "\n" unless index_list =~ /#{path}/ |
57 |
| - end |
58 |
| - |
59 |
| - s3.put_object bucket: bucket, key: index, body: index_list |
60 |
| - end |
| 3 | + sh "./scripts/deploy.sh" |
61 | 4 | end
|
0 commit comments