vagrant-lfstacks 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/commands/s3up.rb +53 -0
- data/lib/vagrant-lfstacks/version.rb +1 -1
- data/lib/vagrant-lfstacks.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86f4124ff6b7d7bc03de2ebfcc74958defafe0cb
|
4
|
+
data.tar.gz: b93d10d6a850d2c564b1035821e472ed5aac552a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc5baa3af84b2346d0c5c2d2094f66be08c70b40923f31fc88915739da14901b20a6554b44fedb26e1b1d1a96057d6d3f37a0a40b325824de31a5a6bc844155c
|
7
|
+
data.tar.gz: 543c371a8e8c6ad1f15fcd5bf8d74b1676e2afd78b43e1594fb3f96fc82c37d7a31b677659b8011e5e09be4678147428d688ef8abe897e04871e55c8f0cb4252
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'pp'
|
2
|
+
require 'aws/s3'
|
3
|
+
|
4
|
+
|
5
|
+
#class BootstrapCommand < Vagrant::Command::Base
|
6
|
+
class S3upCommand < Vagrant.plugin(2, :command)
|
7
|
+
|
8
|
+
|
9
|
+
def self.synopsis
|
10
|
+
"This command uploads a file to Livefyre's S3 keyspace."
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute
|
14
|
+
|
15
|
+
opt_hash = {}
|
16
|
+
v_opts = OptionParser.new do |opts|
|
17
|
+
opts.banner = 'Usage: vagrant s3up BOX S3_BUCKET. Example: vagrant s3up testing.box livefyre-vagrant-boxes'
|
18
|
+
end
|
19
|
+
|
20
|
+
argv = parse_options(v_opts)
|
21
|
+
|
22
|
+
unless argv && argv.size == 2
|
23
|
+
@env.ui.error "Need BOX and/or S3_BUCKET argument. See -h for details"
|
24
|
+
return 1
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
box_file = argv[0]
|
29
|
+
bucket_name = argv[1]
|
30
|
+
|
31
|
+
begin
|
32
|
+
aws_creds = YAML.load_file("#{ENV['HOME']}/.s3_keys")
|
33
|
+
rescue Exception => e
|
34
|
+
@env.ui.error "You need a valid .s3_keys yaml file in your HOME dir, currently using: #{ENV['HOME']} as HOME path See README for details"
|
35
|
+
return 1
|
36
|
+
end
|
37
|
+
|
38
|
+
unless File.extname(box_file) == '.box'
|
39
|
+
@env.ui.error "Only box extension files allowed for upload. See -h for details"
|
40
|
+
return 1
|
41
|
+
end
|
42
|
+
|
43
|
+
AWS::S3::Base.establish_connection!(aws_creds)
|
44
|
+
|
45
|
+
s3_boxes = AWS::S3::Bucket.find(bucket_name)
|
46
|
+
|
47
|
+
AWS::S3::S3Object.store(box_file, open(box_file), bucket_name)
|
48
|
+
@env.ui.info "File: #{box_file} uploaded to Bucket: #{s3_boxes.name}"
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
end #end execute
|
53
|
+
end
|
data/lib/vagrant-lfstacks.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-lfstacks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Navid Khalili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/commands/repuppet.rb
|
72
72
|
- lib/commands/rssh.rb
|
73
73
|
- lib/commands/s3box.rb
|
74
|
+
- lib/commands/s3up.rb
|
74
75
|
- lib/vagrant-lfstacks.rb
|
75
76
|
- lib/vagrant-lfstacks/utils.rb
|
76
77
|
- lib/vagrant-lfstacks/version.rb
|