capistrano-shortcuts 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +22 -0
- data/lib/capistrano/shortcuts.rb +1 -1
- data/lib/capistrano/shortcuts/tasks/deploy_config.rake +55 -0
- data/lib/capistrano/shortcuts/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31aa0f4f9163dec3015d1607598c1b38806098da
|
4
|
+
data.tar.gz: 4fdba1e06d5248c438349179867fc666794f8942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab579a9b6d2d1b4d8989770285d797fc5d8bd65a6923124c1a808ce96709915f75d9004fa5fbf589f0c2477564aa9689921b944df5a84bb67e1e2ad177e570af
|
7
|
+
data.tar.gz: 57660e03e450d6f45f622d8ad543f852ba6dc687af5afe1dcb4bea849ccfa6d3aea77407a399e810c4e0c7e8c1fcaa55e369667956243668038f22b4816d047e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -25,6 +25,28 @@ And include the tasks via your Capfile:
|
|
25
25
|
|
26
26
|
require 'capistrano/shortcuts'
|
27
27
|
|
28
|
+
## Config Files
|
29
|
+
|
30
|
+
Push all config files listed in the :linked_files variable to the specified environment:
|
31
|
+
|
32
|
+
cap <environment> config:push
|
33
|
+
|
34
|
+
|
35
|
+
Pull all config files listed in the :linked_files variable down from the specified environment:
|
36
|
+
|
37
|
+
cap <environment> config:pull
|
38
|
+
|
39
|
+
|
40
|
+
Symlink environment-specific .htaccess and robots.txt files to their expected location:
|
41
|
+
|
42
|
+
cap <environment> config:symlink
|
43
|
+
|
44
|
+
|
45
|
+
Push the config files and restart the server to pick up changes immediately:
|
46
|
+
|
47
|
+
cap <environment> config:reconfig
|
48
|
+
|
49
|
+
|
28
50
|
## Maintenance Mode
|
29
51
|
|
30
52
|
Install the maintenance page and show it instead of executing the web app:
|
data/lib/capistrano/shortcuts.rb
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
namespace :config do
|
2
|
+
|
3
|
+
task :symlink do
|
4
|
+
on roles(:app) do
|
5
|
+
execute("ln -sf #{current_path}/public/.htaccess-#{fetch(:rails_env)} #{current_path}/public/.htaccess ")
|
6
|
+
execute("ln -sf #{current_path}/public/robots-#{fetch(:rails_env)}.txt #{current_path}/public/robots.txt ")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
task :push do
|
12
|
+
on roles(:app) do
|
13
|
+
execute("mkdir -p #{shared_path}/config")
|
14
|
+
fetch(:linked_files).each do |file|
|
15
|
+
run_locally do
|
16
|
+
# execute("rsync -avz #{file} ")
|
17
|
+
command = "rsync -avz -rave "
|
18
|
+
if fetch(:aws_key_pair)
|
19
|
+
command += "'ssh -i #{fetch(:aws_key_pair)}' "
|
20
|
+
else
|
21
|
+
command += "'ssh ' "
|
22
|
+
end
|
23
|
+
command += "#{file} #{fetch(:user)}@#{fetch(:domain)}:#{shared_path}/#{file}"
|
24
|
+
execute(command)
|
25
|
+
end
|
26
|
+
execute("chmod 600 #{shared_path}/#{file}")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
task :pull do
|
32
|
+
run_locally do
|
33
|
+
fetch(:linked_files).each do |file|
|
34
|
+
execute("scp #{fetch(:user)}@#{fetch(:domain)}:#{shared_path}/#{file} #{file}")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
task :reconfig do
|
40
|
+
run_locally do
|
41
|
+
execute("cap #{fetch(:stage)} config:push")
|
42
|
+
execute("cap #{fetch(:stage)} deploy:restart")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# task :sitemap do
|
47
|
+
# on roles(:app) do
|
48
|
+
# if fetch(:stage) == :production
|
49
|
+
# execute("cd #{current_path};RAILS_ENV=#{fetch(:stage)} bundle exec rake -s sitemap:refresh")
|
50
|
+
# else
|
51
|
+
# execute("cd #{current_path};RAILS_ENV=#{fetch(:rails_env)} bundle exec rake -s sitemap:refresh:no_ping")
|
52
|
+
# end
|
53
|
+
# end
|
54
|
+
# end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-shortcuts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Gehman
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- bin/setup
|
56
56
|
- capistrano-shortcuts.gemspec
|
57
57
|
- lib/capistrano/shortcuts.rb
|
58
|
+
- lib/capistrano/shortcuts/tasks/deploy_config.rake
|
58
59
|
- lib/capistrano/shortcuts/tasks/deploy_memcache.rake
|
59
60
|
- lib/capistrano/shortcuts/tasks/deploy_web.rake
|
60
61
|
- lib/capistrano/shortcuts/version.rb
|