cap-strap 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cap-strap might be problematic. Click here for more details.
- data/README.md +9 -1
- data/cap-strap.gemspec +1 -1
- data/lib/cap-strap/recipes/bootstrap.rb +4 -2
- data/spec/bootstrap_spec.rb +36 -2
- metadata +16 -16
data/README.md
CHANGED
@@ -28,6 +28,8 @@ You may re-run the deploy_key task by `$ cap <stage> bootstrap:upload_deploy_key
|
|
28
28
|
|
29
29
|
In your deploy.rb, you may override the following variables:
|
30
30
|
|
31
|
+
You may specificy any additional packages for installation by setting the :packages.
|
32
|
+
|
31
33
|
Note: Paths are relative to the root
|
32
34
|
|
33
35
|
* `set :deploy_user, "<name of user for future deployes>"`
|
@@ -44,6 +46,7 @@ Note: Paths are relative to the root
|
|
44
46
|
]`
|
45
47
|
* `set :gemset, "<default gemset>"` - Default is global
|
46
48
|
* `set :global_gems, ["bundler", "other-gem"]` - Default is ["bundler"]
|
49
|
+
* `set :packages, ["git", "vim"]` - default: []
|
47
50
|
|
48
51
|
Note: Run from project root
|
49
52
|
|
@@ -51,9 +54,14 @@ Note: Run from project root
|
|
51
54
|
|
52
55
|
## Testing
|
53
56
|
|
54
|
-
We're https://github.com/
|
57
|
+
We're https://github.com/fnichol/minitest-capistrano for testing the capistrano
|
55
58
|
configuration.
|
56
59
|
|
60
|
+
Running Tests:
|
61
|
+
|
62
|
+
* `rake test` - manually run the tests
|
63
|
+
* `bundle exec guard start` - Use guard to watch for changes and run tests automatically.
|
64
|
+
|
57
65
|
### Testing with Vagrant
|
58
66
|
|
59
67
|
Vagrant will fetch a lucid-64 box and boot it up. Once started, it will run
|
data/cap-strap.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "cap-strap"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.6"
|
7
7
|
s.authors = ["Shaun Dern"]
|
8
8
|
s.email = ["shaun@substantial.com"]
|
9
9
|
s.homepage = "http://github.com/substantial/cap-strap"
|
@@ -18,6 +18,7 @@ module Capistrano::CapStrap
|
|
18
18
|
_cset(:authorized_keys_file) { Capistrano::CLI.ui.ask("Location of authorized keys relative to root to upload: ") }
|
19
19
|
_cset(:deploy_key_file) { Capistrano::CLI.ui.ask("Location of deploy key for upload, press enter to skip: ") }
|
20
20
|
_cset(:known_hosts) { default_known_hosts }
|
21
|
+
_cset(:packages) { [] }
|
21
22
|
|
22
23
|
namespace :bootstrap do
|
23
24
|
desc "Bootstraps a fresh box. Install RVM, create the deploy user, upload keys."
|
@@ -28,10 +29,11 @@ module Capistrano::CapStrap
|
|
28
29
|
bootstrap.add_known_hosts
|
29
30
|
bootstrap.add_rvm_to_sudoers
|
30
31
|
bootstrap.upload_deploy_key
|
32
|
+
bootstrap.install_specified_packages
|
31
33
|
end
|
32
34
|
|
33
|
-
task :
|
34
|
-
|
35
|
+
task :install_specified_packages do
|
36
|
+
install_packages(packages)
|
35
37
|
end
|
36
38
|
|
37
39
|
task :create_deploy_user do
|
data/spec/bootstrap_spec.rb
CHANGED
@@ -3,6 +3,36 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe Capistrano::CapStrap::Bootstrap do
|
4
4
|
load_capistrano_recipe(Capistrano::CapStrap::Bootstrap)
|
5
5
|
|
6
|
+
describe "tasks" do
|
7
|
+
it "has a default task" do
|
8
|
+
recipe.must_have_task "bootstrap:default"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "has a create_deploy_user task" do
|
12
|
+
recipe.must_have_task "bootstrap:create_deploy_user"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "has a upload authorized keys for deploy user task" do
|
16
|
+
recipe.must_have_task "bootstrap:upload_deploy_authorized_keys"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "has a task for adding rvm group to sudoers" do
|
20
|
+
recipe.must_have_task "bootstrap:add_rvm_to_sudoers"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "has one for uploading the deploy user's ssh key" do
|
24
|
+
recipe.must_have_task "bootstrap:upload_deploy_key"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "has a task for installing rvm dependencies" do
|
28
|
+
recipe.must_have_task "bootstrap:install_rvm_dependencies"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "has a task for installing any other specified packages" do
|
32
|
+
recipe.must_have_task "bootstrap:install_specified_packages"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
6
36
|
describe "default variables" do
|
7
37
|
before do
|
8
38
|
Capistrano::CLI.ui.stubs(:ask).returns('prompt')
|
@@ -23,6 +53,10 @@ describe Capistrano::CapStrap::Bootstrap do
|
|
23
53
|
it "prompts for deploy key location if not set" do
|
24
54
|
recipe.fetch(:deploy_key_file).must_equal 'prompt'
|
25
55
|
end
|
56
|
+
|
57
|
+
it "packages is empty" do
|
58
|
+
recipe.fetch(:packages).must_be_empty
|
59
|
+
end
|
26
60
|
end
|
27
61
|
|
28
62
|
describe "variables set" do
|
@@ -32,11 +66,11 @@ describe Capistrano::CapStrap::Bootstrap do
|
|
32
66
|
recipe.set(:known_hosts, "baz")
|
33
67
|
end
|
34
68
|
|
35
|
-
it "doesn't
|
69
|
+
it "doesn't prompt for a bootstrap user" do
|
36
70
|
recipe.fetch(:user).must_equal "foo"
|
37
71
|
end
|
38
72
|
|
39
|
-
it "doesn't
|
73
|
+
it "doesn't prompt for a deploy user" do
|
40
74
|
recipe.fetch(:deploy_user).must_equal "bar"
|
41
75
|
end
|
42
76
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-strap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &70263018397900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.12.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70263018397900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest-capistrano
|
27
|
-
requirement: &
|
27
|
+
requirement: &70263018397020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.0.8
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70263018397020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: minitest-colorize
|
38
|
-
requirement: &
|
38
|
+
requirement: &70263018412160 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.0.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70263018412160
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: guard-minitest
|
49
|
-
requirement: &
|
49
|
+
requirement: &70263018411640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.5.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70263018411640
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: mocha
|
60
|
-
requirement: &
|
60
|
+
requirement: &70263018410980 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.11.1
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70263018410980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: vagrant
|
71
|
-
requirement: &
|
71
|
+
requirement: &70263018410320 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.0.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70263018410320
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: capistrano
|
82
|
-
requirement: &
|
82
|
+
requirement: &70263018409160 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: 2.0.0
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70263018409160
|
91
91
|
description: Bootstrap a machine. Create a deploy user, upload authorized keys and
|
92
92
|
deploy key. Uses RVM to install desired rubies, with patch support.
|
93
93
|
email:
|