akitaonrails-locarails 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +1 -1
- data/bin/locarails +2 -1
- data/lib/locarails/version.rb +1 -1
- data/locarails.gemspec +2 -2
- data/templates/{deploy.common.rb → deploy.common.rb.erb} +10 -6
- metadata +2 -2
data/Manifest
CHANGED
data/bin/locarails
CHANGED
@@ -137,7 +137,8 @@ FileUtils.copy_file("#{config.bin_path}/../templates/locaweb_backup.rb",
|
|
137
137
|
File.open("#{config.local_path}/config/deploy.rb", 'w+') do |out|
|
138
138
|
erb = ERB.new(File.read("#{config.bin_path}/../templates/deploy.rb.erb"))
|
139
139
|
buffer = erb.result(config.send(:binding))
|
140
|
-
|
140
|
+
erb = ERB.new(File.read("#{config.bin_path}/../templates/deploy.common.rb.erb"))
|
141
|
+
buffer << erb.result(config.send(:binding))
|
141
142
|
out.puts buffer
|
142
143
|
end
|
143
144
|
|
data/lib/locarails/version.rb
CHANGED
data/locarails.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{locarails}
|
3
|
-
s.version = "1.1.
|
3
|
+
s.version = "1.1.1"
|
4
4
|
|
5
5
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
6
6
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.description = %q{A maneira mais simples para instalar aplicacoes Rails na hospedagem Linux da Locaweb.}
|
12
12
|
s.email = %q{fabio.akita@locaweb.com.br}
|
13
13
|
s.executables = ["locarails"]
|
14
|
-
s.files = ["bin/locarails", "bin/locarails.cmd", "LICENSE", "Manifest", "README", "locarails.gemspec", "lib/locarails.rb", "lib/locarails/version.rb", "templates/database.locaweb.yml.erb", "templates/deploy.rb.erb", "templates/deploy.common.rb", "templates/locaweb_backup.rb", "templates/ssh_helper.rb", "templates/.gitignore"]
|
14
|
+
s.files = ["bin/locarails", "bin/locarails.cmd", "LICENSE", "Manifest", "README", "locarails.gemspec", "lib/locarails.rb", "lib/locarails/version.rb", "templates/database.locaweb.yml.erb", "templates/deploy.rb.erb", "templates/deploy.common.rb.erb", "templates/locaweb_backup.rb", "templates/ssh_helper.rb", "templates/.gitignore"]
|
15
15
|
s.has_rdoc = true
|
16
16
|
s.homepage = %q{http://www.locaweb.com.br/rails}
|
17
17
|
s.require_paths = ["lib"]
|
@@ -13,16 +13,18 @@ end
|
|
13
13
|
desc "Garante que as configuracoes estao adequadas"
|
14
14
|
task :before_setup do
|
15
15
|
ts = Time.now.strftime("%y%m%d%H%M%S")
|
16
|
+
<% if config.mode == 'git' %>
|
16
17
|
# git folder
|
18
|
+
has_git = false
|
17
19
|
run "test -d #{git_repo} || mkdir -p -m 755 #{git_repo}"
|
18
20
|
run "test -d #{git_repo}/.git || cd #{git_repo} && git init"
|
19
21
|
git_config = File.join(File.dirname(__FILE__), "../.git/config")
|
20
|
-
has_git = false
|
21
22
|
if File.exists?(git_config) && File.read(git_config) !~ /locaweb/
|
22
23
|
`git remote add locaweb #{repository}`
|
23
24
|
`git push locaweb #{branch}`
|
24
25
|
has_git = true
|
25
26
|
end
|
27
|
+
<% end %>
|
26
28
|
|
27
29
|
run "if [ -d #{deploy_to} ]; then mv #{deploy_to} #{deploy_to}-#{ts}.old ; fi"
|
28
30
|
run "test -d #{deploy_to} || mkdir -m 755 #{deploy_to}"
|
@@ -31,12 +33,13 @@ task :before_setup do
|
|
31
33
|
run "if [ -h #{site_path} ]; then mv #{site_path} #{site_path}-#{ts}.old ; fi"
|
32
34
|
run "ln -s #{deploy_to}/current/public #{public_html}/#{application}"
|
33
35
|
put File.read(File.dirname(__FILE__) + "/database.locaweb.yml"), "#{deploy_to}/etc/database.yml"
|
34
|
-
|
35
|
-
# ssh keygen
|
36
|
-
put File.read(File.dirname(__FILE__) + "/ssh_helper.rb"), "#{deploy_to}/etc/ssh_helper.rb"
|
37
|
-
run "test -f .ssh/id_rsa || ruby #{deploy_to}/etc/ssh_helper.rb /home/#{user}/.ssh/id_rsa #{domain} #{user}"
|
38
36
|
|
39
|
-
|
37
|
+
<% if config.mode == 'git' %>
|
38
|
+
if has_git
|
39
|
+
# ssh keygen
|
40
|
+
put File.read(File.dirname(__FILE__) + "/ssh_helper.rb"), "#{deploy_to}/etc/ssh_helper.rb"
|
41
|
+
run "test -f .ssh/id_rsa || ruby #{deploy_to}/etc/ssh_helper.rb /home/#{user}/.ssh/id_rsa #{domain} #{user}"
|
42
|
+
else
|
40
43
|
3.times { puts "" }
|
41
44
|
puts "==============================================================="
|
42
45
|
puts "Rode os seguintes comandos depois de criar seu repositorio Git:"
|
@@ -46,6 +49,7 @@ task :before_setup do
|
|
46
49
|
puts "==============================================================="
|
47
50
|
3.times { puts "" }
|
48
51
|
end
|
52
|
+
<% end %>
|
49
53
|
end
|
50
54
|
|
51
55
|
desc "Prepare the production database before migration"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akitaonrails-locarails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Akita
|
@@ -32,7 +32,7 @@ files:
|
|
32
32
|
- lib/locarails/version.rb
|
33
33
|
- templates/database.locaweb.yml.erb
|
34
34
|
- templates/deploy.rb.erb
|
35
|
-
- templates/deploy.common.rb
|
35
|
+
- templates/deploy.common.rb.erb
|
36
36
|
- templates/locaweb_backup.rb
|
37
37
|
- templates/ssh_helper.rb
|
38
38
|
- templates/.gitignore
|