webflow_cap 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/lib/capistrano/tasks/base.rake +39 -1
- data/webflow_cap.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1062fc6521705bc2b35a6e214298e3b0e8959486
|
4
|
+
data.tar.gz: ab642147c90f33cf298ad78c46d7679a455f5a18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b09d5888b9644935e0eb5affe27190a2806698d0781968770284cf7d1486c8824e4807ba95bad7f0b9565c23d7341f7ff79059c85509dd680bd7dce346fcfce8
|
7
|
+
data.tar.gz: 7a1be336446d4fb479990191bb67c4468f97b1b458a325f49f575f133df33d33aa56e2f03aa3b7222dda148a37a71c7e5ea92d320b4b1a9fd0fa005a9f4cd15c
|
@@ -15,7 +15,7 @@ namespace :load do
|
|
15
15
|
set :server_port, -> { 10000 + ((fetch :user)[3..6] + "0").to_i }
|
16
16
|
|
17
17
|
set :default_env, {
|
18
|
-
'PATH' => "PATH=/docs/#{fetch :user}/.gem/ruby/2.1/bin:/opt/ruby/2.1/bin:$PATH"
|
18
|
+
'PATH' => "PATH=/docs/#{fetch :user}/.gem/ruby/2.1.5/bin:/opt/ruby/2.1.5/bin:$PATH"
|
19
19
|
}
|
20
20
|
end
|
21
21
|
end
|
@@ -49,6 +49,40 @@ exec svlogd -tt ./main
|
|
49
49
|
after 'deploy:started', 'runit:setup_application_server'
|
50
50
|
end
|
51
51
|
|
52
|
+
namespace :htaccess do
|
53
|
+
task :create do
|
54
|
+
on roles :all do
|
55
|
+
if test("[ -e #{shared_path}/.htaccess ]")
|
56
|
+
warn "[skip] .htaccess already exists"
|
57
|
+
elsif fetch(:password_protected)
|
58
|
+
ask(:htaccess_user, fetch(:user))
|
59
|
+
ask(:htaccess_pass, nil)
|
60
|
+
|
61
|
+
htaccess_content = <<-EOF
|
62
|
+
AuthName "#{fetch :application}"
|
63
|
+
AuthType Basic
|
64
|
+
AuthUserFile #{shared_path}/.htpasswd
|
65
|
+
Require valid-user
|
66
|
+
EOF
|
67
|
+
upload! StringIO.new(htaccess_content), "#{shared_path}/.htaccess"
|
68
|
+
execute "htpasswd -dbc #{shared_path}/.htpasswd #{fetch :htaccess_user} #{fetch :htaccess_pass}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
task :remove do
|
74
|
+
on roles :all do
|
75
|
+
if ("[ -e #{shared_path}/.htaccess ]")
|
76
|
+
execute "rm -f #{shared_path}/.htaccess"
|
77
|
+
execute "rm -f #{shared_path}/.htpasswd"
|
78
|
+
execute "rm -f #{current_path}/.htaccess"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
after 'deploy:updated', 'htaccess:create'
|
84
|
+
end
|
85
|
+
|
52
86
|
namespace :apache do
|
53
87
|
task :setup_reverse_proxy do
|
54
88
|
on roles :all do
|
@@ -86,6 +120,10 @@ namespace :deploy do
|
|
86
120
|
task :symlink_shared do
|
87
121
|
on roles :all do
|
88
122
|
execute "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
123
|
+
|
124
|
+
if fetch(:password_protected)
|
125
|
+
execute "ln -nfs #{shared_path}/.htaccess #{release_path}/.htaccess"
|
126
|
+
end
|
89
127
|
end
|
90
128
|
end
|
91
129
|
|
data/webflow_cap.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "webflow_cap"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version = "0.0.
|
16
|
+
gem.version = "0.0.2"
|
17
17
|
|
18
18
|
# dependencies
|
19
19
|
gem.add_dependency 'capistrano', '~>3.2'
|