uberspacify 0.9.2 → 0.9.3
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/lib/uberspacify/base.rb +8 -7
- data/lib/uberspacify/mysql.rb +6 -6
- data/lib/uberspacify/version.rb +1 -1
- metadata +2 -3
data/lib/uberspacify/base.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'capistrano_colors'
|
1
|
+
require 'capistrano_colors'
|
2
2
|
require 'rvm/capistrano'
|
3
3
|
require 'bundler/capistrano'
|
4
4
|
|
5
5
|
def abort_red(msg)
|
6
|
-
abort " * \e[#{1};31mERROR: #{msg}\e[0m"
|
6
|
+
abort " * \e[#{1};31mERROR: #{msg}\e[0m"
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
Capistrano::Configuration.instance.load do
|
10
10
|
|
11
11
|
# required variables
|
@@ -15,7 +15,7 @@ Capistrano::Configuration.instance.load do
|
|
15
15
|
# optional variables
|
16
16
|
_cset(:domain) { nil }
|
17
17
|
_cset(:passenger_port) { rand(61000-32768+1)+32768 } # random ephemeral port
|
18
|
-
|
18
|
+
|
19
19
|
_cset(:deploy_via) { :remote_cache }
|
20
20
|
_cset(:git_enable_submodules) { 1 }
|
21
21
|
_cset(:branch) { 'master' }
|
@@ -28,7 +28,7 @@ Capistrano::Configuration.instance.load do
|
|
28
28
|
set(:use_sudo) { false }
|
29
29
|
set(:rvm_type) { :user }
|
30
30
|
set(:rvm_install_ruby) { :install }
|
31
|
-
set(:rvm_ruby_string) { "ree@rails-#{application}" }
|
31
|
+
set(:rvm_ruby_string) { "ree@rails-#{application}" }
|
32
32
|
|
33
33
|
ssh_options[:forward_agent] = true
|
34
34
|
default_run_options[:pty] = true
|
@@ -48,7 +48,7 @@ Capistrano::Configuration.instance.load do
|
|
48
48
|
run 'uberspace-setup-svscan ; echo 0'
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
namespace :daemontools do
|
53
53
|
task :setup_daemon do
|
54
54
|
daemon_script = <<-EOF
|
@@ -85,6 +85,7 @@ RewriteRule ^(.*)$ http://localhost:#{fetch :passenger_port}/$1 [P]
|
|
85
85
|
path = fetch(:domain) ? "/var/www/virtual/#{fetch :user}/#{fetch :domain}" : "#{fetch :home}/html"
|
86
86
|
run "mkdir -p #{path}"
|
87
87
|
put htaccess, "#{path}/.htaccess"
|
88
|
+
run "chmod +r #{path}/.htaccess"
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
@@ -104,4 +105,4 @@ RewriteRule ^(.*)$ http://localhost:#{fetch :passenger_port}/$1 [P]
|
|
104
105
|
end
|
105
106
|
end
|
106
107
|
|
107
|
-
end
|
108
|
+
end
|
data/lib/uberspacify/mysql.rb
CHANGED
@@ -9,14 +9,14 @@ Capistrano::Configuration.instance.load do
|
|
9
9
|
my_cnf = capture('cat ~/.my.cnf')
|
10
10
|
config = {}
|
11
11
|
%w(development production test).each do |env|
|
12
|
-
|
12
|
+
|
13
13
|
config[env] = {
|
14
14
|
'adapter' => 'mysql2',
|
15
15
|
'encoding' => 'utf8',
|
16
16
|
'database' => "#{fetch :user}_rails_#{fetch :application}_#{env}",
|
17
17
|
'host' => 'localhost'
|
18
18
|
}
|
19
|
-
|
19
|
+
|
20
20
|
my_cnf.match(/^user=(\w+)/)
|
21
21
|
config[env]['username'] = $1
|
22
22
|
|
@@ -25,14 +25,14 @@ Capistrano::Configuration.instance.load do
|
|
25
25
|
|
26
26
|
my_cnf.match(/^port=(\d+)/)
|
27
27
|
config[env]['port'] = $1.to_i
|
28
|
-
|
28
|
+
|
29
29
|
run "mysql -e 'CREATE DATABASE IF NOT EXISTS #{config[env]['database']} CHARACTER SET utf8 COLLATE utf8_general_ci;'"
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
run "mkdir -p #{fetch :shared_path}/config"
|
33
33
|
put config.to_yaml, "#{fetch :shared_path}/config/database.yml"
|
34
|
-
|
34
|
+
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
end
|
38
|
+
end
|
data/lib/uberspacify/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uberspacify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -167,4 +167,3 @@ specification_version: 3
|
|
167
167
|
summary: Uberspacify helps you deploy a Ruby on Rails app on Uberspace, a popular
|
168
168
|
German shared hosting provider.
|
169
169
|
test_files: []
|
170
|
-
has_rdoc:
|