capobvious 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1 +1,61 @@
1
+ Add to the end of Capfile
1
2
  require 'capistrano/ext/capobvious'
3
+
4
+ some task need 7z
5
+ Ubuntu: sudo apt-get install p7zip-full
6
+
7
+
8
+ backup:db
9
+ if you want to backup your production postgres database
10
+ it will create 7z archive at your tmp/backup project folder & shared/backup on server (NOTE: it need p7zip installed on server)
11
+
12
+ backup:sys
13
+ backup your system folder on server to 7z archive at tmp/backup & shared/backup on server (NOTE: need p7zip)
14
+
15
+ backup:clean
16
+ delete all files in server shared/backup folder
17
+
18
+
19
+ assets:precompile
20
+ precompiles assets on developer's machine & sends it to server
21
+ NOTE:
22
+ if in config/deploy.rb will be setted :assets to true, task will run automatically by deploy
23
+
24
+
25
+ db:create
26
+ will create a Postgresql database and user with password that stored in database.yml
27
+
28
+ db:seed
29
+ run rake db:seed with right RAILS_ENV
30
+
31
+ db:pg_import
32
+ import remote server postgresql database to your development postgresql database IT WILL DELETE YOUR DEV DATABASE (NOTE: need installed p7zip)
33
+
34
+
35
+ rake TASK=db:seed
36
+ runs custom rake task
37
+
38
+
39
+
40
+ nginx:restart
41
+ nginx:reload
42
+ nginx:start
43
+ nginx:stop
44
+
45
+
46
+
47
+ bundle:install
48
+
49
+
50
+ log:tail
51
+ catch errors with tail -f log
52
+
53
+
54
+
55
+ unicorn:start
56
+ unicorn:stop
57
+ unicorn:restart
58
+
59
+
60
+
61
+
data/capobvious.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "capobvious"
@@ -27,7 +27,8 @@ set :db_file_name, "#{database}-#{timestamp}.sql"
27
27
  set :db_archive_ext, "7z"
28
28
 
29
29
 
30
- after "deploy:symlink", "auto:run"
30
+ #after "deploy:symlink", "auto:run"
31
+ before "deploy:restart", "auto:run"
31
32
  after "deploy:setup", "db:create", "nginx:conf"
32
33
  namespace :auto do
33
34
  task :run do
@@ -87,17 +88,16 @@ namespace :db do
87
88
  end
88
89
  end
89
90
 
90
- #==== PRIKHA-START ====
91
- desc "Run custom task usage: cap run_rake_task TASK=patch:project_category"
92
- task :run_rake_task do
91
+ # PRIKHA-TASK
92
+ desc "Run custom task usage: cap rake TASK=patch:project_category"
93
+ task :rake do
93
94
  if ENV.has_key?('TASK')
94
95
  p "running rake task: #{ENV['TASK']}"
95
96
  run "cd #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} #{ENV['TASK']}"
96
97
  else
97
- puts 'Please specify correct task: cap run_rake_task TASK= some_task'
98
+ puts 'Please specify correct task: cap rake TASK= some_task'
98
99
  end
99
100
  end
100
- #==== PRIKHA-END ====
101
101
 
102
102
  namespace :backup do
103
103
  desc "Backup a database"
@@ -139,14 +139,10 @@ end
139
139
  namespace :assets do
140
140
  desc "Assets precompile"
141
141
  task :precompile do
142
- if exists?(:assets) && fetch(:assets) == true
143
- system("bundle exec rake assets:precompile && cd public && tar czf assets.tar.gz assets/")
144
- upload("public/assets.tar.gz","#{current_path}/public/assets.tar.gz")
145
- system("rm public/assets.tar.gz && rm -rf tmp/assets && mv public/assets tmp/assets")
146
- run("cd #{current_path}/public && rm -rf assets/ && tar xzf assets.tar.gz && rm assets.tar.gz")
147
- else
148
- puts "assets is disabled in config/deploy.rb to enable add line set :assets, true"
149
- end
142
+ system("bundle exec rake assets:precompile && cd public && tar czf assets.tar.gz assets/")
143
+ upload("public/assets.tar.gz","#{current_path}/public/assets.tar.gz")
144
+ system("rm public/assets.tar.gz && rm -rf tmp/assets && mv public/assets tmp/assets")
145
+ run("cd #{current_path}/public && rm -rf assets/ && tar xzf assets.tar.gz && rm assets.tar.gz")
150
146
  end
151
147
  end
152
148
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capobvious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: