vagrant-babushka 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,6 +12,8 @@ https://github.com/tcurdt/vagrant-boxes/blob/master/plugins/babushka_provisioner
12
12
  In Vagrant file set provisioner to `:babushka`
13
13
 
14
14
  config.vm.provision :babushka do |b|
15
+ # Uncoment to override default babushka branch on bootstrap
16
+ # b.bootstrap_branch = 'master'
15
17
  # Path for local deps, relative to Vagrantfile.
16
18
  # Syncronized to '/home/ssh_user_name/babushka-deps' on guest machine.
17
19
  # 'ssh_user_name' here is 'vagrant' by default or any other name you use when connecting through ssh.
@@ -34,7 +36,8 @@ Also you can add options to deps giving hash as third parameter
34
36
 
35
37
  ## Thanks
36
38
  [patcon](https://github.com/patcon)
37
- [wakeless](https://github.com/wakeless)
39
+ [wakeless](https://github.com/wakeless)
40
+ [Val](https://github.com/Val)
38
41
 
39
42
  ## License
40
43
 
@@ -1,17 +1,19 @@
1
1
  module VagrantPlugins
2
2
  module Babushka
3
3
  class Config < Vagrant.plugin("2", :config)
4
- attr_accessor :args, :deps, :local_deps_path
4
+ attr_accessor :args, :deps, :local_deps_path, :bootstrap_branch
5
5
 
6
6
  def initialize
7
7
  super
8
8
  @deps = []
9
9
  @local_deps_path = UNSET_VALUE
10
+ @bootstrap_branch = UNSET_VALUE
10
11
  end
11
12
 
12
13
  def finalize!
13
14
  @deps = [] if @deps == UNSET_VALUE
14
15
  @local_deps_path = nil if @local_deps_path == UNSET_VALUE
16
+ @bootstrap_branch = nil if @bootstrap_branch == UNSET_VALUE
15
17
  end
16
18
 
17
19
  def local_dep(dep_name, args = {})
@@ -8,6 +8,7 @@ module VagrantPlugins
8
8
 
9
9
  def configure(root_config)
10
10
  @username = @machine.ssh_info[:username]
11
+ @username = root_config.ssh.default.username unless @username
11
12
  @hostname = root_config.vm.hostname
12
13
  if @config.local_deps_path
13
14
  local_path = @config.local_deps_path
@@ -31,9 +32,22 @@ module VagrantPlugins
31
32
  require 'net/http'
32
33
  @machine.env.ui.info("Installing babushka on #{@hostname}.")
33
34
  local_tmpfile = remote_tmpfile = "/tmp/babushka_me_up"
34
- File.open(local_tmpfile, 'w') {|f| f.write `curl https://babushka.me/up` }
35
+ File.open(local_tmpfile, 'w') {|f| f.write `curl #{babushka_uri}` }
35
36
  @machine.communicate.upload(local_tmpfile, remote_tmpfile)
36
- run_remote "bash #{remote_tmpfile}"
37
+ run_remote "#{proxy_env} sh #{remote_tmpfile}"
38
+ end
39
+
40
+ def proxy_env
41
+ vars = ''
42
+ vars_from_env = ENV.select { |k, _| /https_proxy/i.match(k) }
43
+ vars = vars_from_env.to_a.map{ |pair| pair.join('=') }.join(' ') unless vars_from_env.empty?
44
+ vars
45
+ end
46
+
47
+ def babushka_uri
48
+ uri = 'https://babushka.me/up'
49
+ uri = "#{uri}/#{@config.bootstrap_branch}" unless @config.bootstrap_branch.nil?
50
+ uri
37
51
  end
38
52
 
39
53
  def run_remote(command)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Babushka
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-babushka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-04 00:00:00.000000000 Z
12
+ date: 2013-10-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Vagrant provisioner plugin for using Babushka
15
15
  email: