gorilla-capistrano-recipes 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1 +1 @@
1
- gem 'capistrano', '>= 2.4.3' # load v2.4.3 or higher
1
+ require 'capistrano', '>= 2.4.3' # load v2.4.3 or higher
@@ -1,52 +1,56 @@
1
- desc 'Dumps the production database to db/production_data.sql on the remote server'
2
- task :remote_db_dump, :roles => :db, :only => { :primary => true } do
3
- rake = fetch(:rake, "rake")
4
- rails_env = fetch(:rails_env, "production")
5
-
6
- run "cd #{deploy_to}/#{current_dir} && " +
7
- "#{rake} RAILS_ENV=#{rails_env} db:database_dump --trace"
8
- end
9
-
10
- desc 'Loads the production database to db/production_data.sql on the remote server'
11
- task :remote_db_load, :roles => :db, :only => { :primary => true } do
12
- rake = fetch(:rake, "rake")
13
- rails_env = fetch(:rails_env, "production")
14
-
15
- run "cd #{deploy_to}/#{current_dir} && " +
16
- "#{rake} RAILS_ENV=#{rails_env} db:production_data_load --trace"
17
- end
18
-
19
- desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
20
- task :remote_db_download, :roles => :db, :only => { :primary => true } do
21
- download("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql", :via => :scp)
22
- end
23
-
24
- desc 'Uploads db/production_data.sql to the remote production environment from your local machine'
25
- task :remote_db_upload, :roles => :db, :only => { :primary => true } do
26
- upload("db/development_data.sql", "#{deploy_to}/#{current_dir}/db/production_data.sql", :via => :scp)
27
- end
28
-
29
- desc 'Cleans up data dump file'
30
- task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
31
- run "rm #{deploy_to}/#{current_dir}/db/production_data.sql"
32
- end
33
-
34
- desc 'Cleans up data dump file'
35
- task :remote_cache_cleanup, :roles => :app do
36
- run "rm -rf #{deploy_to}/#{current_dir}/cache/* ;true"
37
- end
38
-
39
- desc 'Dumps, downloads and then cleans up the production data dump'
40
- task :remote_db_runner do
41
- remote_db_dump
42
- remote_db_download
43
- remote_db_cleanup
44
- end
45
-
46
- desc 'Dumps, uploads and then cleans up the production data dump'
47
- task :local_db_runner do
48
- remote_db_upload
49
- remote_db_load
50
- remote_cache_cleanup
51
- remote_db_cleanup
1
+ configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist)
2
+
3
+ configuration.load do
4
+ desc 'Dumps the production database to db/production_data.sql on the remote server'
5
+ task :remote_db_dump, :roles => :db, :only => { :primary => true } do
6
+ rake = fetch(:rake, "rake")
7
+ rails_env = fetch(:rails_env, "production")
8
+
9
+ run "cd #{deploy_to}/#{current_dir} && " +
10
+ "#{rake} RAILS_ENV=#{rails_env} db:database_dump --trace"
11
+ end
12
+
13
+ desc 'Loads the production database to db/production_data.sql on the remote server'
14
+ task :remote_db_load, :roles => :db, :only => { :primary => true } do
15
+ rake = fetch(:rake, "rake")
16
+ rails_env = fetch(:rails_env, "production")
17
+
18
+ run "cd #{deploy_to}/#{current_dir} && " +
19
+ "#{rake} RAILS_ENV=#{rails_env} db:production_data_load --trace"
20
+ end
21
+
22
+ desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
23
+ task :remote_db_download, :roles => :db, :only => { :primary => true } do
24
+ download("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql", :via => :scp)
25
+ end
26
+
27
+ desc 'Uploads db/production_data.sql to the remote production environment from your local machine'
28
+ task :remote_db_upload, :roles => :db, :only => { :primary => true } do
29
+ upload("db/development_data.sql", "#{deploy_to}/#{current_dir}/db/production_data.sql", :via => :scp)
30
+ end
31
+
32
+ desc 'Cleans up data dump file'
33
+ task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
34
+ run "rm #{deploy_to}/#{current_dir}/db/production_data.sql"
35
+ end
36
+
37
+ desc 'Cleans up data dump file'
38
+ task :remote_cache_cleanup, :roles => :app do
39
+ run "rm -rf #{deploy_to}/#{current_dir}/cache/* ;true"
40
+ end
41
+
42
+ desc 'Dumps, downloads and then cleans up the production data dump'
43
+ task :remote_db_runner do
44
+ remote_db_dump
45
+ remote_db_download
46
+ remote_db_cleanup
47
+ end
48
+
49
+ desc 'Dumps, uploads and then cleans up the production data dump'
50
+ task :local_db_runner do
51
+ remote_db_upload
52
+ remote_db_load
53
+ remote_cache_cleanup
54
+ remote_db_cleanup
55
+ end
52
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorilla-capistrano-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benny Degezelle