boxes 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +2 -0
  3. data/.rubocop.yml +640 -0
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +0 -2
  6. data/CHANGELOG.md +21 -0
  7. data/Rakefile +17 -22
  8. data/boxes.gemspec +3 -4
  9. data/lib/boxes/command.rb +5 -5
  10. data/lib/boxes/testing.rb +6 -0
  11. data/lib/boxes/testing/command.rb +23 -0
  12. data/lib/boxes/testing/matchers.rb +16 -0
  13. data/lib/boxes/testing/matchers/base_matcher.rb +21 -0
  14. data/lib/boxes/testing/matchers/have_exit_status_matcher.rb +19 -0
  15. data/lib/boxes/testing/matchers/write_to_stdout_matcher.rb +23 -0
  16. data/lib/boxes/version.rb +1 -2
  17. data/scripts/postinstall.sh +2 -2
  18. data/scripts/ruby.sh +7 -7
  19. data/scripts/vmtools.sh +1 -0
  20. data/spec/acceptance/user_builds_box_spec.rb +51 -0
  21. data/spec/acceptance/user_cleans_the_env_spec.rb +15 -0
  22. data/spec/acceptance/user_shows_the_env_spec.rb +49 -0
  23. data/spec/acceptance/user_views_env_help_spec.rb +18 -0
  24. data/spec/acceptance/user_views_help_spec.rb +39 -0
  25. data/spec/acceptance/user_views_version_spec.rb +10 -0
  26. data/spec/acceptance_helper.rb +15 -0
  27. data/spec/boxes/subprocess_spec.rb +4 -1
  28. data/spec/boxes/testing/command_spec.rb +28 -0
  29. data/spec/boxes/testing/matchers/have_exit_status_matcher_spec.rb +33 -0
  30. data/spec/boxes/testing/matchers/write_to_stdout_matcher_spec.rb +33 -0
  31. data/spec/support/env.rb +5 -0
  32. data/spec/support/subprocess_command.sh +7 -0
  33. data/spec/support/tmp.rb +17 -0
  34. data/spec/tmp/.gitkeep +0 -0
  35. data/templates/debian/jessie64.erb +2 -2
  36. data/templates/debian/preseed.cfg +5 -1
  37. data/templates/debian/stretch64.erb +60 -0
  38. data/templates/ubuntu/trusty64.erb +2 -2
  39. data/templates/ubuntu/xenial64.erb +2 -2
  40. metadata +45 -33
  41. data/features/boxes.feature +0 -8
  42. data/features/build.feature +0 -16
  43. data/features/env.feature +0 -18
  44. data/features/support/env.rb +0 -1
  45. data/spec/support/subprocess_command.rb +0 -7
  46. data/templates/ubuntu/wily64.erb +0 -64
@@ -1,8 +0,0 @@
1
- Feature: We can return the boxes help
2
-
3
- Scenario: A successful response
4
- When I run `boxes --help`
5
- Then the output should contain "$ boxes"
6
- Then the output should contain "Usage:"
7
- Then the output should contain "Options:"
8
- And the exit status should be 0
@@ -1,16 +0,0 @@
1
- Feature: We can build boxes
2
-
3
- Scenario: It will error without a name
4
- When I run `boxes build --template=ubuntu/trusty64 --provider=vmware`
5
- Then the output should contain "[!] A name is required!"
6
- And the exit status should be 1
7
-
8
- Scenario: It will error without a provider
9
- When I run `boxes build --name=trusty64-standard --template=ubuntu/trusty64`
10
- Then the output should contain "[!] A provider is required!"
11
- And the exit status should be 1
12
-
13
- Scenario: It will error without a template
14
- When I run `boxes build --name=trusty64-standard --provider=vmware`
15
- Then the output should contain "[!] A template is required!"
16
- And the exit status should be 1
data/features/env.feature DELETED
@@ -1,18 +0,0 @@
1
- Feature: We can manage the boxes environment
2
-
3
- Scenario: It shows the environment by default
4
- When I run `boxes env`
5
- Then the output should contain "Configuration:"
6
- Then the output should contain "Environment Variables:"
7
- And the exit status should be 0
8
-
9
- Scenario: It has a show command
10
- When I run `boxes env show`
11
- Then the output should contain "Configuration:"
12
- Then the output should contain "Environment Variables:"
13
- And the exit status should be 0
14
-
15
- Scenario: It can clean the environment
16
- When I run `boxes env clean`
17
- Then the directory named "~/.boxes/env" does not exist
18
- And the exit status should be 0
@@ -1 +0,0 @@
1
- require 'aruba/cucumber'
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- STDOUT.puts 'A happy output.'
4
-
5
- STDERR.puts 'An unhappy output.'
6
-
7
- exit 5
@@ -1,64 +0,0 @@
1
- {
2
- "provisioners": [
3
- {
4
- "type": "shell",
5
- "scripts": [
6
- "scripts/postinstall.sh",
7
- "scripts/vmtools.sh",
8
- <%- @scripts.each do |script| -%>
9
- "scripts/<%= script %>",
10
- <%- end -%>
11
- "scripts/purge.sh"
12
- ],
13
- "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S bash '{{ .Path }}'"
14
- }
15
- ],
16
-
17
- "builders": [
18
- {
19
- "name": "<%= @name %>",
20
- "type": "<%= @provider %>-iso",
21
- <%- if @provider == "vmware" -%>
22
- "guest_os_type": "ubuntu-64",
23
- "tools_upload_flavor": "linux",
24
- <%- else -%>
25
- "guest_os_type": "Ubuntu_64",
26
- <%- end -%>
27
- "headless": true,
28
-
29
- "iso_url": "http://releases.ubuntu.com/wily/ubuntu-15.10-server-amd64.iso",
30
- "iso_checksum": "86aa35a986eba6e5ad30e3d486d57efe6803ae7ea4859b0216953e9e62871131",
31
- "iso_checksum_type": "sha256",
32
-
33
- "ssh_username": "vagrant",
34
- "ssh_password": "vagrant",
35
- "ssh_timeout": "15m",
36
-
37
- "http_directory": "templates/ubuntu",
38
-
39
- "boot_command": [
40
- "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
41
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
42
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
43
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
44
- "/install/vmlinuz noapic ",
45
- "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
46
- "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
47
- "hostname={{ .Name }} ",
48
- "fb=false debconf/frontend=noninteractive ",
49
- "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
50
- "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
51
- "grub-installer/bootdev=/dev/sda ",
52
- "initrd=/install/initrd.gz -- <enter>"
53
- ],
54
-
55
- "shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"
56
- }
57
- ],
58
-
59
- "post-processors": [
60
- {
61
- "type": "vagrant"
62
- }
63
- ]
64
- }