ricodigo-capistrano-recipes 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/VERSION +1 -1
- data/bin/ricodigo-install-server +0 -24
- data/lib/recipes/push_deploy.rb +10 -3
- data/ricodigo-capistrano-recipes.gemspec +5 -5
- metadata +6 -6
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -24,8 +24,8 @@ GEM
|
|
24
24
|
git (1.2.5)
|
25
25
|
highline (1.6.2)
|
26
26
|
i18n (0.5.0)
|
27
|
-
jeweler (1.6.
|
28
|
-
bundler (~> 1.0
|
27
|
+
jeweler (1.6.3)
|
28
|
+
bundler (~> 1.0)
|
29
29
|
git (>= 1.2.5)
|
30
30
|
rake
|
31
31
|
kgio (2.4.0)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
net-ssh-gateway (1.1.0)
|
52
52
|
net-ssh (>= 1.99.1)
|
53
53
|
rack (1.2.2)
|
54
|
-
rake (0.
|
54
|
+
rake (0.9.2)
|
55
55
|
rcov (0.9.9)
|
56
56
|
shoulda (2.11.3)
|
57
57
|
tzinfo (0.3.27)
|
@@ -68,7 +68,7 @@ DEPENDENCIES
|
|
68
68
|
bundler (~> 1.0.0)
|
69
69
|
capistrano (>= 2.5.9)
|
70
70
|
capistrano-ext (>= 1.2.1)
|
71
|
-
jeweler (~> 1.6.
|
71
|
+
jeweler (~> 1.6.3)
|
72
72
|
magent
|
73
73
|
mongoid
|
74
74
|
net-ssh
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/bin/ricodigo-install-server
CHANGED
@@ -69,29 +69,6 @@ def install_postfix(ssh)
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def setup_firewall(ssh)
|
73
|
-
puts ">> Setup firewall..."
|
74
|
-
|
75
|
-
ssh.exec! "sudo ufw disable" do |channel, stream, data|
|
76
|
-
puts data
|
77
|
-
end
|
78
|
-
|
79
|
-
commands = []
|
80
|
-
commands << "sudo ufw allow to any port 80"
|
81
|
-
commands << "sudo ufw allow to any port 443"
|
82
|
-
commands << "sudo ufw allow to any port 22"
|
83
|
-
commands << "sudo ufw allow to any port 53"
|
84
|
-
commands << "sudo ufw allow to any port 25"
|
85
|
-
commands << "sudo ufw allow to any port 587"
|
86
|
-
commands << "sudo ufw default deny"
|
87
|
-
|
88
|
-
ssh.exec!(commands.join(" && ")) {|c,s,d| puts d }
|
89
|
-
ssh.exec!("sudo ufw enable") {|c,s,d| puts d; c.send_data("yes") }
|
90
|
-
|
91
|
-
ssh.exec! "iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT"
|
92
|
-
ssh.exec! "iptables -A INPUT -i lo -j ACCEPT"
|
93
|
-
end
|
94
|
-
|
95
72
|
def install_rvm(ssh)
|
96
73
|
puts "Installing RVM..."
|
97
74
|
|
@@ -106,7 +83,6 @@ source /etc/rvmrc
|
|
106
83
|
source /usr/local/rvm/scripts/rvm
|
107
84
|
|
108
85
|
rvm install 1.9.2
|
109
|
-
rvm install ree
|
110
86
|
|
111
87
|
rvm use 1.9.2 --default
|
112
88
|
@
|
data/lib/recipes/push_deploy.rb
CHANGED
@@ -5,11 +5,15 @@ Capistrano::Configuration.instance.load do
|
|
5
5
|
task :setup, :roles => :app do
|
6
6
|
server = roles[:app].servers.first
|
7
7
|
|
8
|
+
origin = Capistrano::CLI.ui.ask("Enter repository url to clone:")
|
9
|
+
|
8
10
|
run "rm -rf #{push_deploy_repo}"
|
9
11
|
run "mkdir -p ~/code"
|
10
|
-
run "git clone --depth=1 #{
|
12
|
+
run "git clone --depth=1 #{origin} #{push_deploy_repo}"
|
11
13
|
run "cd #{push_deploy_repo} && git config receive.denyCurrentBranch ignore"
|
12
14
|
|
15
|
+
repo_url = "#{user}\@#{server}:#{push_deploy_repo}"
|
16
|
+
|
13
17
|
hook = %@#!/bin/bash
|
14
18
|
cd ..
|
15
19
|
GIT_DIR=$(pwd)/.git
|
@@ -24,17 +28,20 @@ cap #{environment} deploy
|
|
24
28
|
put hook, hook_path
|
25
29
|
run "chmod 755 #{hook_path}"
|
26
30
|
|
31
|
+
run "cd #{current_path} && git remote rm origin && git remote add origin #{repo_url}"
|
32
|
+
|
27
33
|
puts %@
|
28
34
|
|
29
35
|
== Instructions
|
30
36
|
|
31
37
|
add deploy repository to your remotes
|
32
38
|
|
33
|
-
git remote add deploy #{
|
39
|
+
git remote add deploy #{repo_url}
|
34
40
|
|
35
41
|
add this to your deploy.rb
|
36
42
|
|
37
|
-
set :repository, "#{
|
43
|
+
set :repository, "#{repo_url}"
|
44
|
+
set :branch, "origin/master"
|
38
45
|
|
39
46
|
to deploy a branch just type:
|
40
47
|
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ricodigo-capistrano-recipes}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David A. Cuadrado"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-31}
|
13
13
|
s.default_executable = %q{ricodigo-install-server}
|
14
14
|
s.description = %q{our capistrano recipes. forked from capistrano-recipes}
|
15
15
|
s.email = %q{krawek@gmail.com}
|
@@ -66,7 +66,7 @@ Gem::Specification.new do |s|
|
|
66
66
|
s.add_runtime_dependency(%q<mongoid>, [">= 0"])
|
67
67
|
s.add_runtime_dependency(%q<unicorn>, [">= 0"])
|
68
68
|
s.add_runtime_dependency(%q<magent>, [">= 0"])
|
69
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.
|
69
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.3"])
|
70
70
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
71
71
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
72
72
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
@@ -77,7 +77,7 @@ Gem::Specification.new do |s|
|
|
77
77
|
s.add_dependency(%q<mongoid>, [">= 0"])
|
78
78
|
s.add_dependency(%q<unicorn>, [">= 0"])
|
79
79
|
s.add_dependency(%q<magent>, [">= 0"])
|
80
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.
|
80
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
81
81
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
82
82
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
83
83
|
s.add_dependency(%q<rcov>, [">= 0"])
|
@@ -89,7 +89,7 @@ Gem::Specification.new do |s|
|
|
89
89
|
s.add_dependency(%q<mongoid>, [">= 0"])
|
90
90
|
s.add_dependency(%q<unicorn>, [">= 0"])
|
91
91
|
s.add_dependency(%q<magent>, [">= 0"])
|
92
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.
|
92
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
93
93
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
94
94
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
95
95
|
s.add_dependency(%q<rcov>, [">= 0"])
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 8
|
9
|
+
version: 0.1.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David A. Cuadrado
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-07-31 00:00:00 -05:00
|
18
18
|
default_executable: ricodigo-install-server
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -109,8 +109,8 @@ dependencies:
|
|
109
109
|
segments:
|
110
110
|
- 1
|
111
111
|
- 6
|
112
|
-
-
|
113
|
-
version: 1.6.
|
112
|
+
- 3
|
113
|
+
version: 1.6.3
|
114
114
|
type: :development
|
115
115
|
prerelease: false
|
116
116
|
version_requirements: *id007
|
@@ -208,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
208
|
requirements:
|
209
209
|
- - ">="
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
hash:
|
211
|
+
hash: 2332766521845656132
|
212
212
|
segments:
|
213
213
|
- 0
|
214
214
|
version: "0"
|