kitchenplan 2.1.2 → 2.1.3
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 +4 -4
- data/lib/kitchenplan/cli.rb +38 -3
- data/lib/kitchenplan/config.rb +1 -1
- data/templates/Cheffile.erb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32cea34fe7a07775c3d8da0a3d19db85f64f814c
|
4
|
+
data.tar.gz: 42934cf8be540fe51b4ef094e05964a0e01eb37c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f8ade19c1a676ce9d9356aad0e879e5eb33a60a101bb57d11affdc62647d47c97ab802aa663a0c83538af53a9b205ea888c60184336a52dfe26e28329f4745
|
7
|
+
data.tar.gz: a4697996d5046df36f96d555f847ee6ff00af505aebde83e4f00facfcf954ee65cc6d8400f94fb5d9da72e8ee1573eb4abf90c55d8631ae90a609ed174d8d655
|
data/lib/kitchenplan/cli.rb
CHANGED
@@ -1,13 +1,21 @@
|
|
1
|
+
|
1
2
|
require 'thor'
|
2
3
|
|
3
4
|
module Kitchenplan
|
4
5
|
class Cli < Thor
|
5
6
|
include Thor::Actions
|
6
7
|
|
7
|
-
desc 'setup [<
|
8
|
+
desc 'setup [<gitrepo>] [<target directory>]', 'Setup your workstation to run Kitchenplan and create an example configuration'
|
9
|
+
long_desc <<-LONGDESC
|
10
|
+
`kitchenplan setup` will install the dependencies of Kitchenplan and create a configuration in /opt/kitchenplan (or <target directory>
|
11
|
+
if you pass it along) to use with the `kitchenplan provision` command.
|
12
|
+
|
13
|
+
If you already have a configuration stored in git somewhere, it will ask you to pass the git repo url. If you want to bypass the
|
14
|
+
prompt, pass it along on the commandline. (see .travis.yml for an example)
|
15
|
+
LONGDESC
|
8
16
|
def setup(gitrepo=nil, targetdir='/opt')
|
9
17
|
logo
|
10
|
-
install_clt unless
|
18
|
+
install_clt unless `xcode-select --print-path`
|
11
19
|
if gitrepo
|
12
20
|
fetch(gitrepo, targetdir)
|
13
21
|
else
|
@@ -19,11 +27,25 @@ module Kitchenplan
|
|
19
27
|
create(targetdir)
|
20
28
|
end
|
21
29
|
end
|
30
|
+
unless File.exists?("#{targetdir}/kitchenplan/config/people/#{ENV['USER']}.yml")
|
31
|
+
user_create = yes?("config/people/#{ENV['USER']}.yml does not exist. Do you wish to create it? [y,n]", :green)
|
32
|
+
if user_create
|
33
|
+
create_user(targetdir)
|
34
|
+
end
|
35
|
+
end
|
22
36
|
end
|
23
37
|
|
24
38
|
option :debug, :type => :boolean
|
25
39
|
option :recipes, :type => :array
|
26
|
-
desc 'provision [<
|
40
|
+
desc 'provision [<target directory>] [--debug] [--recipes=x y z]', 'Provision your workstation with Kitchenplan'
|
41
|
+
long_desc <<-LONGDESC
|
42
|
+
`kitchenplan provision` will use the configuration in /opt/kitchenplan (or <target directory>
|
43
|
+
if you pass it along) to provision your workstation using Chef.
|
44
|
+
|
45
|
+
You can optionally pass --debug to see more detail of what's happeling.
|
46
|
+
|
47
|
+
If you just want to install a few recipes pass them along with --recipes and it will override the run list (not the attributes!)
|
48
|
+
LONGDESC
|
27
49
|
def provision(targetdir='/opt')
|
28
50
|
logo
|
29
51
|
prepare_folders(targetdir)
|
@@ -147,6 +169,19 @@ module Kitchenplan
|
|
147
169
|
print_notice("Now start editing the config files in #{targetdir}/kitchenplan/config, push them to a git server and run 'kitchenplan provision'")
|
148
170
|
end
|
149
171
|
|
172
|
+
def create_user(targetdir)
|
173
|
+
print_step("Creating #{ENV['USER']}.yml config")
|
174
|
+
|
175
|
+
template('user.yml.erb', "#{targetdir}/kitchenplan/config/people/#{ENV['USER']}.yml")
|
176
|
+
|
177
|
+
inside("#{targetdir}/kitchenplan") do
|
178
|
+
dorun("git add -A config/people/#{ENV['USER']}.yml")
|
179
|
+
dorun("git commit -q -m 'Initial commit for user #{ENV['USER']}'")
|
180
|
+
end
|
181
|
+
|
182
|
+
print_notice("Now start editing #{ENV['USER']}.yml in #{targetdir}/kitchenplan/config/people, and push it to a git server and run 'kitchenplan provision'")
|
183
|
+
end
|
184
|
+
|
150
185
|
def install_bundler(targetdir)
|
151
186
|
print_step('Setting up bundler')
|
152
187
|
template('Gemfile.erb', "#{targetdir}/kitchenplan/Gemfile")
|
data/lib/kitchenplan/config.rb
CHANGED
@@ -35,7 +35,7 @@ module Kitchenplan
|
|
35
35
|
|
36
36
|
def parse_people_config
|
37
37
|
people_config_path = "config/people/#{Etc.getlogin}.yml"
|
38
|
-
@people_config = (YAML.load(ERB.new(File.read(people_config_path)).result) if File.exist?(people_config_path)) ||
|
38
|
+
@people_config = (YAML.load(ERB.new(File.read(people_config_path)).result) if File.exist?(people_config_path)) || {}
|
39
39
|
end
|
40
40
|
|
41
41
|
def parse_group_configs(group = (( @default_config['groups'] || [] ) | ( @people_config['groups'] || [] )))
|
data/templates/Cheffile.erb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
site "http://community.opscode.com/api/v1"
|
2
2
|
|
3
|
-
cookbook "homebrewalt", :github => "kitchenplan/chef-homebrewalt", :ref => "v1.8.
|
3
|
+
cookbook "homebrewalt", :github => "kitchenplan/chef-homebrewalt", :ref => "v1.8.2"
|
4
4
|
cookbook "nodejs", :github => "kitchenplan/chef-nodejs", :ref => "v1.1"
|
5
|
-
cookbook "applications", :github => "kitchenplan/chef-applications", :ref => "v2.0.
|
5
|
+
cookbook "applications", :github => "kitchenplan/chef-applications", :ref => "v2.0.2"
|
6
6
|
cookbook "osxdefaults", :github => "kitchenplan/chef-osxdefaults", :ref => "v1.0.1"
|
7
7
|
cookbook "dotfiles", :github => "kitchenplan/chef-dotfiles", :ref => "v1.1"
|
8
8
|
cookbook "drivers", :github => "kitchenplan/chef-drivers", :ref => "v1.0"
|
9
9
|
cookbook "sudoalt", :github => "kitchenplan/chef-sudoalt", :ref => "v2.4"
|
10
10
|
cookbook "dmg", :github => "opscode-cookbooks/dmg", :ref => "v2.1.4"
|
11
|
-
cookbook "composer", :github => "kitchenplan/chef-composer", :ref => "v1.0"
|
11
|
+
cookbook "composer", :github => "kitchenplan/chef-composer", :ref => "v1.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchenplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roderik van der Veer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|