rails_pwnerer 0.6.89 → 0.6.90
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/lib/rails_pwnerer/app/cluster_config.rb +2 -1
- data/lib/rails_pwnerer/app/files.rb +24 -7
- data/lib/rails_pwnerer/app/main.rb +2 -2
- data/rails_pwnerer.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -84,7 +84,8 @@ class RailsPwnerer::App::ClusterConfig
|
|
84
84
|
end
|
85
85
|
|
86
86
|
static_cmd = "thin start -a 127.0.0.1 -c #{app_path} -u #{pwnerer_user} " +
|
87
|
-
"-g #{pwnerer_group} -e #{environment} -d "
|
87
|
+
"-g #{pwnerer_group} -e #{environment} -d " +
|
88
|
+
" --tag rpwn_#{app_name}.#{instance_name} "
|
88
89
|
|
89
90
|
# TODO: start the servers simultaneously
|
90
91
|
Dir.chdir app_path do
|
@@ -29,8 +29,8 @@ class RailsPwnerer::App::Files
|
|
29
29
|
Dir.chdir 'tmp' do
|
30
30
|
system "tar -czf ../#{dump_file} #{File.basename(app_path)}"
|
31
31
|
end
|
32
|
-
File.chmod
|
33
|
-
File.chown
|
32
|
+
File.chmod 0400, dump_file
|
33
|
+
File.chown pwnerer_uid, pwnerer_gid, dump_file
|
34
34
|
|
35
35
|
# clean up
|
36
36
|
FileUtils.rm_r cold_copy
|
@@ -106,16 +106,33 @@ class RailsPwnerer::App::Files
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
# Sets the right permissions on the application's working areas.
|
111
|
+
def fix_permissions(app_name, instance_name)
|
112
|
+
pwnerer_user = RailsPwnerer::Config[app_name, instance_name][:pwnerer_user]
|
113
|
+
pwnerer_uid = uid_for_username(pwnerer_user)
|
114
|
+
pwnerer_gid = gid_for_username(pwnerer_user)
|
115
|
+
|
116
|
+
Dir.chdir(RailsPwnerer::Config[app_name, instance_name][:app_path]) do
|
117
|
+
['tmp', 'public'].each do |subdir|
|
118
|
+
FileUtils.mkdir_p subdir unless File.exist?(subdir)
|
119
|
+
FileUtils.chmod_R 0775, subdir
|
120
|
+
FileUtils.chown_R pwnerer_uid, pwnerer_gid, subdir
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
109
124
|
|
110
125
|
def setup(app_name, instance_name)
|
111
|
-
scaffold_backup
|
126
|
+
scaffold_backup app_name, instance_name
|
127
|
+
fix_permissions app_name, instance_name
|
128
|
+
end
|
129
|
+
|
130
|
+
def update(app_name, instance_name)
|
131
|
+
scaffold_backup app_name, instance_name
|
132
|
+
fix_permissions app_name, instance_name
|
112
133
|
end
|
113
134
|
|
114
135
|
def remove(app_name, instance_name)
|
115
136
|
drop_files(app_name, instance_name)
|
116
137
|
end
|
117
|
-
|
118
|
-
def update(app_name, instance_name)
|
119
|
-
scaffold_backup(app_name, instance_name)
|
120
|
-
end
|
121
138
|
end
|
@@ -35,7 +35,7 @@ module RailsPwnerer::App
|
|
35
35
|
Scripts.new.post_start app, instance
|
36
36
|
else
|
37
37
|
if success == :next
|
38
|
-
print "rails_pwange only supports git, subversion, and perforce at this time
|
38
|
+
print "rails_pwange only supports git, subversion, and perforce at this time.\n"
|
39
39
|
else
|
40
40
|
print "You didn't checkout a Rails application. Check your remote path.\n"
|
41
41
|
end
|
@@ -55,7 +55,7 @@ module RailsPwnerer::App
|
|
55
55
|
mod.new.update_prefetch app, instance
|
56
56
|
end
|
57
57
|
update_app app, instance do
|
58
|
-
[Git, Perforce, Svn, Config, Gems, Database, Scripts].each do |mod|
|
58
|
+
[Git, Perforce, Svn, Config, Gems, Files, Database, Scripts].each do |mod|
|
59
59
|
mod.new.update app, instance
|
60
60
|
end
|
61
61
|
end
|
data/rails_pwnerer.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rails_pwnerer}
|
5
|
-
s.version = "0.6.
|
5
|
+
s.version = "0.6.90"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Victor Costan"]
|
9
|
-
s.date = %q{2011-
|
9
|
+
s.date = %q{2011-04-10}
|
10
10
|
s.default_executable = %q{bin/rpwn}
|
11
11
|
s.description = %q{Rails deployment hack.}
|
12
12
|
s.email = %q{victor@costan.us}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_pwnerer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 179
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 90
|
10
|
+
version: 0.6.90
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Costan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-10 00:00:00 -04:00
|
19
19
|
default_executable: bin/rpwn
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|