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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f95597ff7c38a0522acbbf46b291ebb17e9053e6
4
- data.tar.gz: 4ccb4319c32f4e0e3f7e3ee4fd2ed7b5f51cc46b
3
+ metadata.gz: 86f4124ff6b7d7bc03de2ebfcc74958defafe0cb
4
+ data.tar.gz: b93d10d6a850d2c564b1035821e472ed5aac552a
5
5
  SHA512:
6
- metadata.gz: 510c98fe2af6fdb2f0d8c59aa837283c22c44178340018c128d05147dbb0ab4a4cf24203d58125cc5f8b5d58f86554e2a10b7cc04c44fc133b6e741bfda0bccc
7
- data.tar.gz: 9a9fc870d7c0c89f48de5e52323d0be9c018f5b401dba07dc14cce3d07c144db67c3cfb8dbcbba6b6888a9f09b15f02730429d880136b709fd743be5acc9f3f3
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
@@ -1,4 +1,4 @@
1
1
  module Lfstacks
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.4"
3
3
  end
4
4
 
@@ -19,6 +19,11 @@ module Lfstacks
19
19
  require_relative 'commands/s3box'
20
20
  S3boxCommand
21
21
  end
22
+
23
+ command 's3up' do
24
+ require_relative 'commands/s3up'
25
+ S3upCommand
26
+ end
22
27
 
23
28
  command "bootstrap" do
24
29
  require_relative 'commands/bootstrap'
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.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-05 00:00:00.000000000 Z
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