cap-strap 0.0.8 → 0.0.9
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/cap-strap.gemspec +4 -3
- data/lib/cap-strap/recipes/bootstrap.rb +39 -36
- metadata +29 -18
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.9"
|
7
7
|
s.authors = ["Shaun Dern"]
|
8
8
|
s.email = ["shaun@substantial.com"]
|
9
9
|
s.homepage = "http://github.com/substantial/cap-strap"
|
@@ -17,11 +17,12 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_development_dependency "
|
20
|
+
s.add_development_dependency "rake", "~> 0.9.2.2"
|
21
|
+
s.add_development_dependency "minitest", "~> 2.12.1"
|
21
22
|
s.add_development_dependency "minitest-capistrano", "~> 0.0.8"
|
22
23
|
s.add_development_dependency "minitest-colorize", "~> 0.0.4"
|
23
24
|
s.add_development_dependency "guard-minitest", "~> 0.5.0"
|
24
|
-
s.add_development_dependency "mocha", "~> 0.11.
|
25
|
+
s.add_development_dependency "mocha", "~> 0.11.3"
|
25
26
|
s.add_development_dependency "vagrant", "~> 1.0.2"
|
26
27
|
|
27
28
|
s.add_dependency "capistrano", ">= 2.0.0"
|
@@ -13,36 +13,36 @@ module Capistrano::CapStrap
|
|
13
13
|
libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf
|
14
14
|
libc6-dev ncurses-dev automake libtool bison subversion )
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
_cset(:deploy_user) { Capistrano::CLI.ui.ask("deploy user: ") }
|
17
|
+
_cset(:user) { Capistrano::CLI.ui.ask("bootstrap root user: ") }
|
18
|
+
_cset(:authorized_keys_file) { Capistrano::CLI.ui.ask("Location of authorized keys relative to root to upload: ") }
|
19
|
+
_cset(:deploy_key_file) { Capistrano::CLI.ui.ask("Location of deploy key for upload, press enter to skip: ") }
|
20
|
+
_cset(:known_hosts) { default_known_hosts }
|
21
|
+
_cset(:packages) { [] }
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
namespace :bootstrap do
|
24
|
+
desc "Bootstraps a fresh box. Install RVM, create the deploy user, upload keys."
|
25
|
+
task :default do
|
26
|
+
rvm.default
|
27
|
+
bootstrap.create_deploy_user
|
28
|
+
bootstrap.upload_deploy_authorized_keys
|
29
|
+
bootstrap.add_known_hosts
|
30
|
+
bootstrap.add_rvm_to_sudoers
|
31
|
+
bootstrap.upload_deploy_key
|
32
|
+
bootstrap.install_specified_packages
|
33
|
+
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
task :install_specified_packages do
|
36
|
+
install_packages(packages)
|
37
|
+
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
task :create_deploy_user do
|
40
|
+
create_user(deploy_user)
|
41
|
+
add_user_to_group(deploy_user, "rvm")
|
42
|
+
add_user_to_group(deploy_user, "admin")
|
43
|
+
end
|
44
44
|
|
45
|
-
|
45
|
+
desc "Upload authorized keys for the deploy_user. Override by setting :authorized_keys_file. This
|
46
46
|
is the relative path from the project root"
|
47
47
|
task :upload_deploy_authorized_keys do
|
48
48
|
begin
|
@@ -57,17 +57,18 @@ module Capistrano::CapStrap
|
|
57
57
|
rescue Exception => e
|
58
58
|
puts e
|
59
59
|
end
|
60
|
-
|
60
|
+
end
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
task :add_known_hosts do
|
63
|
+
put(known_hosts, "known_hosts", :mode => "0644")
|
64
|
+
sudo "mkdir -p /home/#{deploy_user}/.ssh"
|
65
|
+
sudo "mv ~/known_hosts /home/#{deploy_user}/.ssh/known_hosts"
|
66
|
+
sudo "chown -R #{deploy_user}:rvm /home/#{deploy_user}/.ssh"
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
task :add_rvm_to_sudoers do
|
70
|
+
add_group_to_sudoers("rvm")
|
71
|
+
end
|
71
72
|
|
72
73
|
task :install_rvm_dependencies do
|
73
74
|
install_packages(rvm_packages)
|
@@ -83,6 +84,8 @@ module Capistrano::CapStrap
|
|
83
84
|
puts "************Looking for Deploy key at: #{deploy_key_path}"
|
84
85
|
id_rsa = File.read(deploy_key_path)
|
85
86
|
put(id_rsa, "id_rsa", :mode => "0600")
|
87
|
+
sudo "mkdir -p /home/#{deploy_user}/.ssh"
|
88
|
+
sudo "chmod 0700 /home/#{deploy_user}/.ssh"
|
86
89
|
sudo "mv ~/id_rsa /home/#{deploy_user}/.ssh/"
|
87
90
|
sudo "chown -R #{deploy_user}:rvm /home/#{deploy_user}/.ssh"
|
88
91
|
rescue Exception => e
|
@@ -90,7 +93,7 @@ module Capistrano::CapStrap
|
|
90
93
|
end
|
91
94
|
end
|
92
95
|
end
|
93
|
-
|
96
|
+
end
|
94
97
|
end
|
95
98
|
end
|
96
99
|
end
|
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.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,33 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &70296715639640 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.2.2
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70296715639640
|
14
25
|
- !ruby/object:Gem::Dependency
|
15
26
|
name: minitest
|
16
|
-
requirement: &
|
27
|
+
requirement: &70296715636900 !ruby/object:Gem::Requirement
|
17
28
|
none: false
|
18
29
|
requirements:
|
19
30
|
- - ~>
|
20
31
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.12.
|
32
|
+
version: 2.12.1
|
22
33
|
type: :development
|
23
34
|
prerelease: false
|
24
|
-
version_requirements: *
|
35
|
+
version_requirements: *70296715636900
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: minitest-capistrano
|
27
|
-
requirement: &
|
38
|
+
requirement: &70296715636080 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
41
|
- - ~>
|
@@ -32,10 +43,10 @@ dependencies:
|
|
32
43
|
version: 0.0.8
|
33
44
|
type: :development
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *70296715636080
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: minitest-colorize
|
38
|
-
requirement: &
|
49
|
+
requirement: &70296715634720 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ~>
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: 0.0.4
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *70296715634720
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: guard-minitest
|
49
|
-
requirement: &
|
60
|
+
requirement: &70296715634040 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ~>
|
@@ -54,21 +65,21 @@ dependencies:
|
|
54
65
|
version: 0.5.0
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70296715634040
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: mocha
|
60
|
-
requirement: &
|
71
|
+
requirement: &70296715633040 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ~>
|
64
75
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.11.
|
76
|
+
version: 0.11.3
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70296715633040
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: vagrant
|
71
|
-
requirement: &
|
82
|
+
requirement: &70296715648840 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ~>
|
@@ -76,10 +87,10 @@ dependencies:
|
|
76
87
|
version: 1.0.2
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70296715648840
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: capistrano
|
82
|
-
requirement: &
|
93
|
+
requirement: &70296715647060 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,7 +98,7 @@ dependencies:
|
|
87
98
|
version: 2.0.0
|
88
99
|
type: :runtime
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *70296715647060
|
91
102
|
description: Bootstrap a machine. Install packages, create a deploy user, upload authorized
|
92
103
|
keys and deploy key. Uses RVM to install desired rubies, with patch support.
|
93
104
|
email:
|