capistrano-shortcuts 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66629d80df71c92e7306bc993cee510cdc3adb19
4
- data.tar.gz: e575b4bedd5686d4a9f2f623e34beabfe461a713
3
+ metadata.gz: 31aa0f4f9163dec3015d1607598c1b38806098da
4
+ data.tar.gz: 4fdba1e06d5248c438349179867fc666794f8942
5
5
  SHA512:
6
- metadata.gz: acda133c73e03c7b037822b841b7d20b29fbc69ab4419177268d851cb3ba3987a1386fb43862bd3c72ca0f59bfb087140ab447b5263bea6dafec561f5f396044
7
- data.tar.gz: 2fefe4de8c6eb84d25bd6ded31c218dde272c3b0468ac9209d3939fbb1df561959df01939dc99a10748e204290bffb1dc4a95d0864aff43d00c1e9560ed1ac5f
6
+ metadata.gz: ab579a9b6d2d1b4d8989770285d797fc5d8bd65a6923124c1a808ce96709915f75d9004fa5fbf589f0c2477564aa9689921b944df5a84bb67e1e2ad177e570af
7
+ data.tar.gz: 57660e03e450d6f45f622d8ad543f852ba6dc687af5afe1dcb4bea849ccfa6d3aea77407a399e810c4e0c7e8c1fcaa55e369667956243668038f22b4816d047e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-shortcuts (0.2.0)
4
+ capistrano-shortcuts (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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:
@@ -1,6 +1,6 @@
1
1
  require "capistrano/shortcuts/version"
2
2
 
3
- [:memcache, :web].each do |token|
3
+ [:config, :memcache, :web].each do |token|
4
4
  load File.expand_path("../shortcuts/tasks/deploy_#{token}.rake", __FILE__)
5
5
  end
6
6
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Shortcuts
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.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