ninja-deploy 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,6 +2,135 @@
2
2
 
3
3
  Common shared deployment recipes.
4
4
 
5
+
6
+ == Assumptions
7
+
8
+ * The user has local tasks to set up variables specfic to the deploying environment (ie. staging, production, etc.).
9
+
10
+
11
+ == Database Recipes
12
+
13
+ Require the database recipes in your deploy.rb file:
14
+
15
+ require 'ninja_deploy/recipes/database'
16
+
17
+ === dump
18
+
19
+ Dependencies:
20
+
21
+ * The user acting during the deployment must have permissions to dump the MySQL database.
22
+
23
+ ==== To Local File
24
+
25
+ Dumps the contents of a remote database to a MySQL dump file, scp's the file to /tmp directory.
26
+
27
+ cap production db:dump:to_local_file
28
+
29
+ ==== To Local Database
30
+
31
+ Dumps the contents of a remote database to a MySQL dump file, scp's the file to /tmp directory, loads the locally configured
32
+ development database and deletes the local and remote dump files.
33
+
34
+ cap production db:dump:to_local_db
35
+
36
+ Dependencies:
37
+
38
+ * The configured local development user must have permission to load the database form a MySQL dump file.
39
+
40
+
41
+ == Log Recipes
42
+
43
+ Require the database recipes in your deploy.rb file:
44
+
45
+ require 'ninja_deploy/recipes/log'
46
+
47
+ === tail
48
+
49
+ Tails the remote server's log for the current environment.
50
+
51
+ cap production log:tail
52
+
53
+
54
+ == Passenger Recipes
55
+
56
+ Require the database recipes in your deploy.rb file:
57
+
58
+ require 'ninja_deploy/recipes/passenger'
59
+
60
+ === restart
61
+
62
+ Restarts Passenger.
63
+
64
+ As Callback:
65
+
66
+ after "deploy:update_code", "passenger:restart"
67
+
68
+ From Command-Line:
69
+
70
+ cap production passenger:restart
71
+
72
+
73
+ == Sass Recipes
74
+
75
+ Require the database recipes in your deploy.rb file:
76
+
77
+ require 'ninja_deploy/recipes/sass'
78
+
79
+ === update
80
+
81
+ Generates the CSS files from the Sass files.
82
+
83
+ As Callback:
84
+
85
+ before "deploy:restart", "sass:update"
86
+
87
+ From Command-Line:
88
+
89
+ cap production sass:update
90
+
91
+
92
+ == Version Recipes
93
+
94
+ Require the database recipes in your deploy.rb file:
95
+
96
+ require 'ninja_deploy/recipes/version'
97
+
98
+ === write
99
+
100
+ Writes a public/VERSION file to the remote server.
101
+
102
+ As Callback:
103
+
104
+ after "deploy:update_code", "version:write"
105
+
106
+ Dependencies:
107
+
108
+ * branch_tag_or_sha_to_deploy variable
109
+
110
+
111
+ == Whenever Recipes
112
+
113
+ Require the database recipes in your deploy.rb file:
114
+
115
+ require 'ninja_deploy/recipes/whenever'
116
+
117
+ === update_crontab
118
+
119
+ Updates the crontab file using whenever.
120
+
121
+ As Callback:
122
+
123
+ after "deploy:update_code", "whenever:update_crontab"
124
+
125
+ From Command-Line:
126
+
127
+ cap production whenever:update_crontab
128
+
129
+ Dependencies:
130
+
131
+ * application variable
132
+
133
+
5
134
  == Note on Patches/Pull Requests
6
135
 
7
136
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 1.0.0
@@ -0,0 +1,7 @@
1
+ Capistrano::Configuration.instance( :must_exist ).load do
2
+ namespace :log do
3
+ task :tail, :roles => :app do
4
+ invoke_command "tail -f #{shared_path}/log/#{rails_env}.log"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+ namespace :passenger do
3
+ desc "Restart the passenger module to reload the application after deploying."
4
+ task :restart, :roles => :app, :except => {:no_release => true} do
5
+ sudo "touch #{current_path}/tmp/restart.txt"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance( :must_exist ).load do
2
+ namespace :sass do
3
+ desc 'Updates the stylesheets generated by Sass'
4
+ task :update, :roles => :app do
5
+ invoke_command "cd #{latest_release}; rake app:sass:update RAILS_ENV=#{rails_env}"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance( :must_exist ).load do
2
+ namespace :version do
3
+ desc 'Writes a VERSION file to the public directory of the application'
4
+ task :write do
5
+ run "echo #{branch_tag_or_sha_to_deploy} > #{release_path}/public/VERSION"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance( :must_exist ).load do
2
+ namespace :whenever do
3
+ desc "Update the crontab file using whenever"
4
+ task :update_crontab, :roles => :db do
5
+ run "cd #{release_path} && bundle exec whenever --set environment=#{rails_env} --update-crontab #{application}"
6
+ end
7
+ end
8
+ end
data/ninja-deploy.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ninja-deploy}
8
- s.version = "0.1.0"
8
+ s.version = "1.0.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ninja Loss"]
@@ -26,6 +26,11 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "lib/ninja_deploy.rb",
28
28
  "lib/ninja_deploy/recipes/database.rb",
29
+ "lib/ninja_deploy/recipes/log.rb",
30
+ "lib/ninja_deploy/recipes/passenger.rb",
31
+ "lib/ninja_deploy/recipes/sass.rb",
32
+ "lib/ninja_deploy/recipes/version.rb",
33
+ "lib/ninja_deploy/recipes/whenever.rb",
29
34
  "ninja-deploy.gemspec",
30
35
  "spec/ninja-deploy_spec.rb",
31
36
  "spec/spec.opts",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninja-deploy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
- - 0
8
7
  - 1
9
8
  - 0
10
- version: 0.1.0
9
+ - 0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ninja Loss
@@ -67,6 +67,11 @@ files:
67
67
  - VERSION
68
68
  - lib/ninja_deploy.rb
69
69
  - lib/ninja_deploy/recipes/database.rb
70
+ - lib/ninja_deploy/recipes/log.rb
71
+ - lib/ninja_deploy/recipes/passenger.rb
72
+ - lib/ninja_deploy/recipes/sass.rb
73
+ - lib/ninja_deploy/recipes/version.rb
74
+ - lib/ninja_deploy/recipes/whenever.rb
70
75
  - ninja-deploy.gemspec
71
76
  - spec/ninja-deploy_spec.rb
72
77
  - spec/spec.opts