vbuilder 0.1.3 → 0.2.0

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: e7cb201309103e4e38714ff8e06ab7dea0c80af4
4
- data.tar.gz: a42ee5e45c572d8e94ce1532f8053590574a6d14
3
+ metadata.gz: 2aa4ce1e93e33c4e9102335a4ecc0e22b79d0ae2
4
+ data.tar.gz: 40706e0936dcaf1e6cded1cd2ab972d5d5cdd3b9
5
5
  SHA512:
6
- metadata.gz: 9b4040f6c70c0f480f32eb2fc9762a76d1fd23f3e7c0f44c52e250d546202d3152990fc0dd751a3a4c8d9ee7761f9ba06181c17b3cc692cea44e36ad6a5b8e76
7
- data.tar.gz: 540d3353eb8955a185ceaf127ccc99d6ea3811aeaa08ad3189da813698da9577c05410bc68398e478c548ffeb7ce629ccecf3b0627ad918eb1d52bd636132a0c
6
+ metadata.gz: 29175e940678b751fc84285b1f625cfa66d3d09168ed57fcd0597c6444936fd9c7a9a6f6fcdf0998393e82d1c58676312462a1b69e0e51319648ce2f240e212a
7
+ data.tar.gz: c0f6740b4f56d8021ba114b178c6a392a6f91f387d06a2039c89e0cf1b56c03831ea32457db9fea8ca88eee2d70a868415aa21fe19eea302498983e200485c04
data/lib/helper.rb CHANGED
@@ -41,10 +41,11 @@ class Vbuilder
41
41
 
42
42
  module Cli
43
43
 
44
+ # this method gets kicked off when the user chooses to interactively create it
44
45
  def self.start_cli(attributes)
45
46
  cli = HighLine.new
46
47
  attributes.each do |key, value|
47
- if key != "dependencies" && key != "provider"
48
+ if key != "meta"
48
49
  case attributes[key]
49
50
  when Array
50
51
  attributes[key] = cli.ask("#{key} - (comma sep list) :", lambda { |val|val.split(/,\s*/) })
@@ -1,7 +1,8 @@
1
1
  # YAML Containing attributes to build basic Vagrantfile with aws as provider
2
2
 
3
- dependencies: ["vagrant-aws"]
4
- provider: aws
3
+ meta:
4
+ :dependencies: ["vagrant-aws"]
5
+ :provider: aws
5
6
  access_key_id: ""
6
7
  secret_access_key: ""
7
8
  session_token: ""
@@ -1,14 +0,0 @@
1
- # YAML Containing attributes to build basic Vagrantfile with aws as provider
2
-
3
- dependencies: ["vagrant-aws"]
4
- provider: aws
5
- access_key_id:
6
- secret_access_key:
7
- session_token:
8
- keypair_name:
9
- ami:
10
- instance_type:
11
- security_groups: []
12
- iam_instance_profile_name:
13
- ebs_volume_size: 8
14
- tags: []
@@ -15,7 +15,7 @@ class Vbuilder
15
15
  end
16
16
 
17
17
  def render(provider)
18
- template_file = "../../templates/providers/#{@provider}.erb"
18
+ template_file = "../../templates/providers/#{@meta[:provider]}.erb"
19
19
  file = File.expand_path(template_file, __FILE__)
20
20
  content = File.read(file)
21
21
  t = ERB.new(content)
@@ -25,7 +25,7 @@ class Vbuilder
25
25
 
26
26
  def check_dependencies
27
27
  installed = `vagrant plugin list`
28
- @dependencies.each do |dependency|
28
+ @meta[:dependencies].each do |dependency|
29
29
  if !installed.include? dependency
30
30
  puts "Unmet dependency"
31
31
  puts "Missing plugin '#{dependency}'"
@@ -1,7 +1,73 @@
1
- Vagrant.configure("2") do |config|
2
- config.vm.box = "<%= @vm_box %>"
3
- config.ssh.username = "<%= @ssh_username %>"
4
- config.ssh.pty = true
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
5
3
 
6
- <%= render @provider %>
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure(2) do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Every Vagrant development environment requires a box. You can search for
14
+ # boxes at https://atlas.hashicorp.com/search.
15
+ config.vm.box = "<%= @vm_box %>"
16
+ # config.ssh.username = "user"
17
+ # config.ssh.pty = true
18
+ <%= render @meta[:provider] %>
19
+ # Disable automatic box update checking. If you disable this, then
20
+ # boxes will only be checked for updates when the user runs
21
+ # `vagrant box outdated`. This is not recommended.
22
+ # config.vm.box_check_update = false
23
+
24
+ # Create a forwarded port mapping which allows access to a specific port
25
+ # within the machine from a port on the host machine. In the example below,
26
+ # accessing "localhost:8080" will access port 80 on the guest machine.
27
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
28
+
29
+ # Create a private network, which allows host-only access to the machine
30
+ # using a specific IP.
31
+ # config.vm.network "private_network", ip: "192.168.33.10"
32
+
33
+ # Create a public network, which generally matched to bridged network.
34
+ # Bridged networks make the machine appear as another physical device on
35
+ # your network.
36
+ # config.vm.network "public_network"
37
+
38
+ # Share an additional folder to the guest VM. The first argument is
39
+ # the path on the host to the actual folder. The second argument is
40
+ # the path on the guest to mount the folder. And the optional third
41
+ # argument is a set of non-required options.
42
+ # config.vm.synced_folder "../data", "/vagrant_data"
43
+
44
+ # Provider-specific configuration so you can fine-tune various
45
+ # backing providers for Vagrant. These expose provider-specific options.
46
+ # Example for VirtualBox:
47
+ #
48
+ # config.vm.provider "virtualbox" do |vb|
49
+ # # Display the VirtualBox GUI when booting the machine
50
+ # vb.gui = true
51
+ #
52
+ # # Customize the amount of memory on the VM:
53
+ # vb.memory = "1024"
54
+ # end
55
+ #
56
+ # View the documentation for the provider you are using for more
57
+ # information on available options.
58
+
59
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
60
+ # such as FTP and Heroku are also available. See the documentation at
61
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
62
+ # config.push.define "atlas" do |push|
63
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
64
+ # end
65
+
66
+ # Enable provisioning with a shell script. Additional provisioners such as
67
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
68
+ # documentation for more information about their specific syntax and use.
69
+ # config.vm.provision "shell", inline: <<-SHELL
70
+ # sudo apt-get update
71
+ # sudo apt-get install -y apache2
72
+ # SHELL
7
73
  end
@@ -1,16 +1,16 @@
1
- config.vm.provider :<%= @provider %> do |<%= @provider %>, override|
2
- <%= @provider %>.access_key_id = "<%= @access_key_id %>"
3
- <%= @provider %>.secret_access_key = "<%= @secret_access_key %>"
4
- <%= @provider %>.keypair_name = "<%= @keypair_name %>"
1
+ config.vm.provider :<%= @meta[:provider] %> do |<%= @meta[:provider] %>, override|
2
+ <%= @meta[:provider] %>.access_key_id = "<%= @access_key_id %>"
3
+ <%= @meta[:provider] %>.secret_access_key = "<%= @secret_access_key %>"
4
+ <%= @meta[:provider] %>.keypair_name = "<%= @keypair_name %>"
5
5
 
6
- <%= @provider %>.ami = "<%= @ami %>"
7
- <%= @provider %>.instance_type = "<%= @instance_type %>"
8
- <%= @provider %>.security_groups = <%= @security_groups %>
9
- <%= @provider %>.iam_instance_profile_name = "<%= @iam_instance_profile_name %>"
6
+ <%= @meta[:provider] %>.ami = "<%= @ami %>"
7
+ <%= @meta[:provider] %>.instance_type = "<%= @instance_type %>"
8
+ <%= @meta[:provider] %>.security_groups = <%= @security_groups %>
9
+ <%= @meta[:provider] %>.iam_instance_profile_name = "<%= @iam_instance_profile_name %>"
10
10
 
11
- <%= @provider %>.block_device_mapping = [{ 'DeviceName' => '/dev/xvda', 'Ebs.VolumeSize' => <%= @ebs_volume_size %> }]
12
- <%= @provider %>.tags = {
13
- 'Name' => ''
14
- }
15
- override.ssh.private_key_path = ""
16
- end
11
+ <%= @meta[:provider] %>.block_device_mapping = [{ 'DeviceName' => '/dev/xvda', 'Ebs.VolumeSize' => <%= @ebs_volume_size %> }]
12
+ <%= @meta[:provider] %>.tags = {
13
+ 'Name' => ''
14
+ }
15
+ override.ssh.private_key_path = ""
16
+ end
@@ -1,8 +1,8 @@
1
1
  class Vbuilder
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 1
5
- PATCH = 3
4
+ MINOR = 2
5
+ PATCH = 0
6
6
  BUILD = nil
7
7
 
8
8
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian DesJardins
@@ -80,10 +80,7 @@ files:
80
80
  - lib/vbuilder/generator/provider.rb
81
81
  - lib/vbuilder/templates/master.erb
82
82
  - lib/vbuilder/templates/providers/aws.erb
83
- - lib/vbuilder/templates/providers/docker.erb
84
- - lib/vbuilder/templates/providers/hyperv.erb
85
83
  - lib/vbuilder/templates/providers/virtualbox.erb
86
- - lib/vbuilder/templates/providers/vmware.erb
87
84
  - lib/vbuilder/version.rb
88
85
  - vbuilder.gemspec
89
86
  homepage: https://github.com/iandesj/vbuilder
File without changes
File without changes
File without changes