This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #855 from boxen/nuke-etc-boxen

Support moving all Homebrew configurations to `$HOMEBREW_ROOT/etc/boxen`
  • Loading branch information...
jacobbednarz committed Oct 16, 2017
2 parents d2accf9 + 1c04307 commit 6ab8bb38a84372d76b95273a7578353ac3ad65e3
Showing with 165 additions and 55 deletions.
  1. +6 −3 .travis.yml
  2. +4 −1 Gemfile
  3. +12 −3 Gemfile.lock
  4. +6 −6 Puppetfile
  5. +10 −16 Puppetfile.lock
  6. +2 −5 manifests/site.pp
  7. +26 −15 script/nuke
  8. +25 −0 spec/localhost/cli_spec.rb
  9. +11 −0 spec/localhost/directories_spec.rb
  10. +5 −0 spec/localhost/git_spec.rb
  11. +5 −0 spec/localhost/hub_spec.rb
  12. +7 −0 spec/localhost/packages_spec.rb
  13. +0 −5 spec/localhost/sample_spec.rb
  14. +19 −0 spec/localhost/services/dnsmasq_spec.rb
  15. +27 −0 spec/localhost/services/nginx_spec.rb
  16. +0 −1 spec/spec_helper.rb
  17. BIN vendor/cache/json-1.8.3.gem
  18. BIN vendor/cache/json-2.1.0.gem
  19. BIN vendor/cache/thor-0.19.1.gem
  20. BIN vendor/cache/thor-0.20.0.gem
  21. BIN vendor/puppet/cache/boxen-puppet-boxen-3.12.0.tar.gz
  22. BIN vendor/puppet/cache/boxen-puppet-boxen-3.13.0.tar.gz
  23. BIN vendor/puppet/cache/boxen-puppet-dnsmasq-2.0.4.tar.gz
  24. BIN vendor/puppet/cache/boxen-puppet-hub-1.4.4.tar.gz
  25. BIN vendor/puppet/cache/boxen-puppet-hub-1.4.5.tar.gz
  26. BIN vendor/puppet/cache/boxen-puppet-nginx-1.7.0.tar.gz
  27. BIN vendor/puppet/cache/boxen-puppet-nginx-1.9.0.tar.gz
  28. BIN vendor/puppet/cache/boxen-puppet-ruby-8.5.4.tar.gz
  29. BIN vendor/puppet/cache/boxen-puppet-ruby-8.6.0.tar.gz
  30. BIN vendor/puppet/source/20ee2f742d66e40fc34e9727fcd41b5854a86fe6.tar.gz
  31. BIN vendor/puppet/source/4354afb53b59956dc85a49d267e2cadac62a3d4c.tar.gz
  32. BIN vendor/puppet/source/7beaf6bd48cbd429e0325758b67846d137aba06f.tar.gz
  33. BIN vendor/puppet/source/88d9d4930c3c754aed4e06d2f10247e61ba3db7d.tar.gz
  34. BIN vendor/puppet/source/920d6b42c68603ffdc12427c93e1d647e8624fdd.tar.gz
  35. BIN vendor/puppet/source/9332672d5396ea9d1c7f28ed70829d5dfb628d7d.tar.gz
  36. BIN vendor/puppet/source/abc7639a1e266cebbe37e4cd443c3b247e3832d7.tar.gz
  37. BIN vendor/puppet/source/bdc179a75ff935cca77142332ac91ed69d663750.tar.gz
  38. BIN vendor/puppet/source/c70468aa3e348cac81b18f7116ef6641ea8142c6.tar.gz
  39. BIN vendor/puppet/source/d32d778e8cf7062d87c470b2eecde3947ec74edd.tar.gz
  40. BIN vendor/puppet/source/dfcaffd5380c379b22058758948112ca20682337.tar.gz
  41. BIN vendor/puppet/source/f0ce0a77db592eb8c646322a9339f4585459acf0.tar.gz
View
@@ -1,12 +1,15 @@
os:
- osx
script:
- rm -rf /usr/local/Homebrew
- travis_wait 60 rvm implode --force
- travis_wait 60 ./script/boxen --no-fde --no-pull --profile --login $BOXEN_GITHUB_LOGIN --token $BOXEN_GITHUB_TOKEN || test $? -eq 2
- ./script/boxen --no-fde --stealth --no-pull --debug --profile --login $BOXEN_GITHUB_LOGIN --token $BOXEN_GITHUB_TOKEN || test $? -eq 2
- source /opt/boxen/env.sh
- rake spec
- bundle exec rspec spec
before_install:
- sudo gem install bundler -v '~> 1.13'
env:
global:
secure: HoCPuAgujmw+tdH7qq9bSymtpE8o4gpp1uYRyFin2TB3px2JdOPCPCb754vddmE12zhhKKSy1j0Uj/qeW6tjy9hIhlAjLAGFuT+mNTURqu4nmojCgKO2ApcRWc3yv319XR2vjUDW1qmEyKm7il4q1c/dOFmGbVYeDixjUUfWVII=
- HOMEBREW_NO_AUTO_UPDATE=1
- HOMEBREW_VERBOSE=1
- secure: HoCPuAgujmw+tdH7qq9bSymtpE8o4gpp1uYRyFin2TB3px2JdOPCPCb754vddmE12zhhKKSy1j0Uj/qeW6tjy9hIhlAjLAGFuT+mNTURqu4nmojCgKO2ApcRWc3yv319XR2vjUDW1qmEyKm7il4q1c/dOFmGbVYeDixjUUfWVII=
View
@@ -2,8 +2,11 @@ source "https://rubygems.org"
gem "boxen", "~> 2.9.0"
gem "hiera", "~> 1.3.3"
gem "librarian-puppet", "~> 1.0.9"
gem "librarian-puppet"
gem "puppet", "3.7.1"
gem "librarianp",
git: "https://github.com/voxpupuli/librarian.git",
branch: "librarianp"
gem "puppet-lint", "0.3.2"
gem "puppetlabs_spec_helper", "0.4.1"
gem "open4", "~> 1.3.4"
View
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/voxpupuli/librarian.git
revision: 4d78d88be2d7673a136e78760085fbf9664ff27d
branch: librarianp
specs:
librarianp (0.6.3)
thor (~> 0.15)
GEM
remote: https://rubygems.org/
specs:
@@ -28,7 +36,7 @@ GEM
highline (1.6.21)
jmespath (1.0.2)
multi_json (~> 1.0)
json (1.8.3)
json (2.1.0)
json_pure (1.8.2)
librarian (0.1.2)
highline
@@ -91,7 +99,7 @@ GEM
net-ssh (>= 2.7, < 4.0)
net-telnet
sfl
thor (0.19.1)
thor (0.20.0)
PLATFORMS
ruby
@@ -101,7 +109,8 @@ DEPENDENCIES
boxen (~> 2.9.0)
deep_merge (~> 1.0)
hiera (~> 1.3.3)
librarian-puppet (~> 1.0.9)
librarian-puppet
librarianp!
net-ssh
open4 (~> 1.3.4)
puppet (= 3.7.1)
View
@@ -29,7 +29,7 @@ end
# Includes many of our custom types and providers, as well as global
# config. Required.
github "boxen", "3.12.0"
github "boxen", "3.13.0"
# Support for default hiera data in modules
@@ -39,21 +39,21 @@ github "module_data", "0.0.4", :repo => "ripienaar/puppet-module-data"
# some/most of these if you want, but it's not recommended.
github "brewcask", "0.0.10"
github "dnsmasq", "2.0.3"
github "dnsmasq", "2.0.4"
github "foreman", "1.2.0"
github "gcc", "3.0.2"
# mod "gcc", "0.0.1", :git => "https://github.com/boxen/puppet-gcc.git", :ref => "abc7639"
github "git", "2.13.0"
github "go", "2.1.0"
github "homebrew", "2.1.0"
github "hub", "1.4.4"
github "hub", "1.4.5"
github "inifile", "1.4.1", :repo => "puppetlabs/puppetlabs-inifile"
github "nginx", "1.7.0"
github "nginx", "1.9.0"
github "nodejs", "5.0.9"
github "openssl", "1.0.0"
github "phantomjs", "3.0.0"
github "pkgconfig", "1.0.0"
github "repository", "2.4.1"
github "ruby", "8.5.4"
github "ruby", "8.6.0"
github "stdlib", "4.7.0", :repo => "puppetlabs/puppetlabs-stdlib"
github "sudo", "1.0.0"
github "xquartz", "1.2.1"
View
@@ -1,7 +1,7 @@
GITHUBTARBALL
remote: boxen/puppet-boxen
specs:
boxen (3.12.0)
boxen (3.13.0)
GITHUBTARBALL
remote: boxen/puppet-brewcask
@@ -11,18 +11,13 @@ GITHUBTARBALL
GITHUBTARBALL
remote: boxen/puppet-dnsmasq
specs:
dnsmasq (2.0.3)
dnsmasq (2.0.4)
GITHUBTARBALL
remote: boxen/puppet-foreman
specs:
foreman (1.2.0)
GITHUBTARBALL
remote: boxen/puppet-gcc
specs:
gcc (3.0.2)
GITHUBTARBALL
remote: boxen/puppet-git
specs:
@@ -41,12 +36,12 @@ GITHUBTARBALL
GITHUBTARBALL
remote: boxen/puppet-hub
specs:
hub (1.4.4)
hub (1.4.5)
GITHUBTARBALL
remote: boxen/puppet-nginx
specs:
nginx (1.7.0)
nginx (1.9.0)
GITHUBTARBALL
remote: boxen/puppet-nodejs
@@ -76,7 +71,7 @@ GITHUBTARBALL
GITHUBTARBALL
remote: boxen/puppet-ruby
specs:
ruby (8.5.4)
ruby (8.6.0)
GITHUBTARBALL
remote: boxen/puppet-sudo
@@ -104,24 +99,23 @@ GITHUBTARBALL
module_data (0.0.4)
DEPENDENCIES
boxen (= 3.12.0)
boxen (= 3.13.0)
brewcask (= 0.0.10)
dnsmasq (= 2.0.3)
dnsmasq (= 2.0.4)
foreman (= 1.2.0)
gcc (= 3.0.2)
git (= 2.13.0)
go (= 2.1.0)
homebrew (= 2.1.0)
hub (= 1.4.4)
hub (= 1.4.5)
inifile (= 1.4.1)
module_data (= 0.0.4)
nginx (= 1.7.0)
nginx (= 1.9.0)
nodejs (= 5.0.9)
openssl (= 1.0.0)
phantomjs (= 3.0.0)
pkgconfig (= 1.0.0)
repository (= 2.4.1)
ruby (= 8.5.4)
ruby (= 8.6.0)
stdlib (= 4.7.0)
sudo (= 1.0.0)
xquartz (= 1.2.1)
View
@@ -1,6 +1,6 @@
require boxen::environment
require homebrew
require gcc
/* require gcc */
Exec {
group => 'staff',
@@ -69,10 +69,7 @@
nodejs::version { '0.12': }
# default ruby versions
ruby::version { '1.9.3': }
ruby::version { '2.0.0': }
ruby::version { '2.1.8': }
ruby::version { '2.2.4': }
ruby::version { '2.4.1': }
# common, useful packages
package {
View
@@ -6,27 +6,29 @@ unless ENV["USER"] == "root"
exec "sudo", $0, *ARGV
end
all = false
force = false
opt = false
services = false
receipts = false
gitconfig = false
all = false
force = false
opt = false
services = false
receipts = false
gitconfig = false
homebrew_config = false
OptionParser.new do |o|
o.banner = "Remove most traces of Boxen from your machine."
o.banner = "Remove traces of Boxen from your machine."
o.on("--all", "Remove everything possible.") { all = true }
o.on("--force", "Actually do it.") { force = true }
o.on("--help", "Show this help.") { abort o.to_s }
o.on("--opt", "Remove /opt/boxen.") { opt = true }
o.on("--services", "Remove and unload services.") { services = true }
o.on("--receipts", "Remove package receipts used by Puppet.") { receipts = true }
o.on("--gitconfig", "Remove Boxen-provided git credential helper config.") { gitconfig = true }
o.on("--all", "Remove everything possible.") { all = true }
o.on("--force", "Actually do it.") { force = true }
o.on("--help", "Show this help.") { abort o.to_s }
o.on("--opt", "Remove /opt/boxen.") { opt = true }
o.on("--services", "Remove and unload services.") { services = true }
o.on("--receipts", "Remove package receipts used by Puppet.") { receipts = true }
o.on("--gitconfig", "Remove Boxen-provided git credential helper config.") { gitconfig = true }
o.on("--homebrew-config", "Remove Boxen managed Homebrew package configuration files.") { homebrew_config = true }
o.parse!
abort o.to_s unless all || opt || services || receipts || gitconfig
abort o.to_s unless all || opt || services || receipts || gitconfig || homebrew_config
end
unless force
@@ -64,3 +66,12 @@ if all || gitconfig
warn "-> Removing git credential helper config."
system "/usr/bin/git", "config", "--global", "--unset", "credential.helper"
end
if all || homebrew_config
%w(/opt/boxen/config /usr/local/etc/boxen).each do |homebrew_path|
if File.exist? homebrew_path
warn "-> Removing Boxen managed Homebrew package configuration files from #{homebrew_path}"
system "rm", "-rf", homebrew_path if force
end
end
end
View
@@ -0,0 +1,25 @@
require 'spec_helper'
# describe 'script/nuke' do
# describe command('/opt/boxen/repo/script/nuke --help') do
# its(:stdout) { should include '--all' }
# its(:stdout) { should include '--force' }
# its(:stdout) { should include '--opt' }
# its(:stdout) { should include '--services' }
# its(:stdout) { should include '--receipts' }
# its(:stdout) { should include '--gitconfig' }
# its(:stdout) { should include '--homebrew-config' }
# end
# describe '--homebrew-config' do
# it "cleans out $HOMEBREW_ROOT" do
# creation_command_exit_status = command('touch $HOMEBREW_ROOT/etc/boxen/service.config').exit_status
# cleanup_command_exit_status = command('/opt/boxen/repo/script/nuke --force --homebrew-config').exit_status
# file_count_stdout = command('find $HOMEBREW_ROOT/etc/boxen -type f | wc -l').stdout.strip
# expect(creation_command_exit_status).to eq(0)
# expect(cleanup_command_exit_status).to eq(0)
# expect(file_count_stdout).to eq("0")
# end
# end
# end
@@ -0,0 +1,11 @@
require 'spec_helper'
describe file('/opt/boxen/repo') do
it { should be_directory }
end
describe 'Boxen managed configuration files' do
describe file('/usr/local/etc/boxen') do
it { should be_directory }
end
end
@@ -0,0 +1,5 @@
require 'spec_helper'
describe package('git') do
it { should be_installed }
end
@@ -0,0 +1,5 @@
require 'spec_helper'
describe package('hub') do
it { should be_installed }
end
@@ -0,0 +1,7 @@
require 'spec_helper'
%w(ack findutils gnu-tar).each do |package_name|
describe package(package_name) do
it { should be_installed }
end
end

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,19 @@
require 'spec_helper'
describe 'dnsmasq' do
describe file('/usr/local/etc/boxen/dnsmasq') do
it { should be_directory }
end
describe file('/usr/local/etc/boxen/dnsmasq/dnsmasq.conf') do
it { should be_file }
end
describe file('/opt/boxen/data/dnsmasq') do
it { should be_directory }
end
describe file('/opt/boxen/log/dnsmasq') do
it { should be_directory }
end
end
@@ -0,0 +1,27 @@
require 'spec_helper'
describe 'nginx' do
describe file('/usr/local/etc/boxen/nginx') do
it { should be_directory }
end
describe file('/usr/local/etc/boxen/nginx/sites') do
it { should be_directory }
end
describe file('/usr/local/etc/boxen/nginx/public') do
it { should be_directory }
end
describe file('/usr/local/etc/boxen/nginx/nginx.conf') do
it { should be_file }
end
describe file('/opt/boxen/log/nginx') do
it { should be_directory }
end
describe file('/opt/boxen/data/nginx') do
it { should be_directory }
end
end
View
@@ -1,4 +1,3 @@
require 'serverspec'
set :backend, :exec
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6ab8bb3

Please sign in to comment.