inploy 1.1.0 → 1.2.0
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.
- data/README.textile +13 -2
- data/Rakefile +2 -2
- data/lib/inploy/deploy.rb +11 -7
- data/lib/inploy/helper.rb +2 -2
- metadata +5 -5
data/README.textile
CHANGED
@@ -39,8 +39,16 @@ Actually, Inploy has four rake tasks:
|
|
39
39
|
|
40
40
|
h2. INSTALLATION:
|
41
41
|
|
42
|
+
As a plugin:
|
43
|
+
|
42
44
|
<pre><code>script/plugin install git://github.com/dcrec1/inploy.git</code></pre>
|
43
45
|
|
46
|
+
As a gem:
|
47
|
+
|
48
|
+
<pre><code>sudo gem install inploy</code></pre>
|
49
|
+
|
50
|
+
Please remember that when used as a gem, Inploy should be available in the deploy servers.
|
51
|
+
|
44
52
|
h2. CONFIGURATION
|
45
53
|
|
46
54
|
Create a config/deploy.rb file and configure it something like this:
|
@@ -49,9 +57,12 @@ Create a config/deploy.rb file and configure it something like this:
|
|
49
57
|
deploy.repository = 'git://github.com/dcrec1/signal.git'
|
50
58
|
deploy.user = 'dcrec1'
|
51
59
|
deploy.hosts = ['hooters', 'geni']
|
52
|
-
deploy.path = '/opt'
|
60
|
+
deploy.path = '/opt'
|
61
|
+
|
62
|
+
# OPTIONALS
|
53
63
|
|
54
|
-
|
64
|
+
deploy.ssh_opts = '-A' # default empty
|
65
|
+
deploy.branch = 'production' # default master</code></pre>
|
55
66
|
|
56
67
|
h2. LICENSE:
|
57
68
|
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
|
|
5
5
|
require 'spec/rake/spectask'
|
6
6
|
|
7
7
|
GEM = "inploy"
|
8
|
-
GEM_VERSION = "1.
|
8
|
+
GEM_VERSION = "1.2.0"
|
9
9
|
SUMMARY = "Rails deployment made easy"
|
10
10
|
AUTHOR = "Diego Carrion"
|
11
11
|
EMAIL = "dc.rec1@gmail.com"
|
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
Spec::Rake::SpecTask.new do |t|
|
30
30
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
31
|
-
t.spec_opts = %w(-
|
31
|
+
t.spec_opts = %w(-fp --color)
|
32
32
|
end
|
33
33
|
|
34
34
|
Rake::GemPackageTask.new(spec) do |pkg|
|
data/lib/inploy/deploy.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
module Inploy
|
2
2
|
class Deploy
|
3
3
|
include Helper
|
4
|
-
|
5
|
-
attr_accessor :repository, :user, :application, :hosts, :path
|
4
|
+
|
5
|
+
attr_accessor :repository, :user, :application, :hosts, :path, :ssh_opts, :branch
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@branch = 'master'
|
9
|
+
end
|
6
10
|
|
7
11
|
def template=(template)
|
8
12
|
require "inploy/#{template}"
|
@@ -10,11 +14,10 @@ module Inploy
|
|
10
14
|
end
|
11
15
|
|
12
16
|
def remote_setup
|
13
|
-
remote_run "cd #{path} && git clone --depth 1 #{repository} #{application} && cd #{application} && rake inploy:local:setup"
|
17
|
+
remote_run "cd #{path} && git clone --depth 1 #{repository} #{application} && cd #{application} && git checkout -f -b #{branch} origin/#{branch} && rake inploy:local:setup"
|
14
18
|
end
|
15
19
|
|
16
20
|
def local_setup
|
17
|
-
copy_sample_files
|
18
21
|
create_folders 'tmp/pids', 'db'
|
19
22
|
run "./init.sh" if File.exists?("init.sh")
|
20
23
|
after_update_code
|
@@ -25,13 +28,14 @@ module Inploy
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def local_update
|
28
|
-
run "git pull origin
|
31
|
+
run "git pull origin #{branch}"
|
29
32
|
after_update_code
|
30
33
|
end
|
31
|
-
|
34
|
+
|
32
35
|
private
|
33
|
-
|
36
|
+
|
34
37
|
def after_update_code
|
38
|
+
copy_sample_files
|
35
39
|
install_gems
|
36
40
|
migrate_database
|
37
41
|
run "rm -R -f public/cache"
|
data/lib/inploy/helper.rb
CHANGED
@@ -49,7 +49,7 @@ module Inploy
|
|
49
49
|
|
50
50
|
def remote_run(command)
|
51
51
|
hosts.each do |host|
|
52
|
-
run "ssh #{user}@#{host} '#{command}'"
|
52
|
+
run "ssh #{ssh_opts} #{user}@#{host} '#{command}'"
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -66,4 +66,4 @@ module Inploy
|
|
66
66
|
rake "gems:install"
|
67
67
|
end
|
68
68
|
end
|
69
|
-
end
|
69
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Carrion
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-02 00:00:00 -02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,13 +22,13 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
-
- lib/tasks/inploy.rake
|
26
|
-
- lib/inploy/locaweb.rb
|
27
25
|
- lib/inploy/deploy.rb
|
28
26
|
- lib/inploy/helper.rb
|
27
|
+
- lib/inploy/locaweb.rb
|
29
28
|
- lib/inploy.rb
|
30
|
-
-
|
29
|
+
- lib/tasks/inploy.rake
|
31
30
|
- Rakefile
|
31
|
+
- README.textile
|
32
32
|
has_rdoc: true
|
33
33
|
homepage: http://www.diegocarrion.com
|
34
34
|
licenses: []
|