if-vlad-recipes 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Readme CHANGED
@@ -7,43 +7,86 @@
7
7
 
8
8
  - Innovation Factory Specific Vlad Recipes.
9
9
 
10
- To get up and running with this, first up add the following to your project's Rakefile:
11
- require 'if-vlad'
12
-
13
- Then make sure that you have a config/deploy.rb file that might look like the following:
14
-
15
- set :user, "deploy"
16
- set :application, "people"
17
- set :repository, "git@github.com:innovationfactory/people.git"
18
- set :revision, "origin/deploy"
19
- set :web_command, "sudo apache2ctl"
20
-
21
- task :acceptance do |t|
22
- set :environment, t.name
23
- set :migrate_args, "RAILS_ENV=#{environment}"
24
- set :deploy_host, "#{application}.#{environment}.innovationfactory.net"
25
- set :domain, "#{user}@#{deploy_host}"
26
- set :deploy_to, "/var/www/deploy/www/#{deploy_host}"
27
- end
28
-
29
- namespace :vlad do
30
- namespace :if do
31
-
32
- desc "Perform a full deploy."
33
- task :deploy => %w[
34
- vlad:if:maintenance:off
35
- vlad:if:update
36
- vlad:if:symlink:shared
37
- vlad:if:touch:shared_log
38
- vlad:if:gems:install
39
- vlad:if:migrate
40
- vlad:if:update_crontab
41
- vlad:if:ts:full_reboot
42
- vlad:if:start
43
- vlad:if:cleanup
44
- vlad:if:maintenance:on
45
- ]
10
+ Quickstart
11
+ ==========
46
12
 
13
+ * To get up and running with this, first up add the following to your project's Rakefile:
14
+
15
+ require 'if-vlad-recipes'
16
+
17
+ * deploy with something like:
18
+
19
+ rake acceptance vlad:if:deploy
20
+
21
+ * For this to work, make sure that you have a config/deploy.rb file that might look like the following:
22
+
23
+ set :user, "deploy"
24
+ set :application, "people"
25
+ set :repository, "git@github.com:innovationfactory/people.git"
26
+ set :revision, "origin/deploy"
27
+ set :web_command, "sudo apache2ctl"
28
+
29
+ task :acceptance do |t|
30
+ set :environment, t.name
31
+ set :migrate_args, "RAILS_ENV=#{environment}"
32
+ set :deploy_host, "#{application}.#{environment}.innovationfactory.net"
33
+ set :domain, "#{user}@#{deploy_host}"
34
+ set :deploy_to, "/var/www/deploy/www/#{deploy_host}"
47
35
  end
48
- end
36
+
37
+
38
+ Local Deployment
39
+ ================
40
+
41
+ Local deployment is a little more tricky. Basically the deal is that the host you're pushing to has absolutely no access to the wider world and you only have a little scp hole to poke everything through for deployment. Heck, you have to install all the gems by hand *yourself* damn, that's painful.
42
+
43
+ Luckily IF-Vlad is here to help you with this situation. You have to go through five
44
+
45
+ 1. Zip the badboy up
46
+ 2. Copy the zip to the remote server
47
+ 3. Unzip the compressed file
48
+ 4. Run the local deploy script from within the newly generated directory
49
+ 5. There's no need for a step three because the first four were so great!
50
+
51
+ Let's look at these in a little more detail...
52
+
53
+ == 1. Zipping zips in zips.
54
+
55
+ * cd into the root of the project
56
+
57
+ * run the zip rake task:
58
+ rake vlad:if:zip
59
+
60
+ * Yey, that's it :-) You're file is now sitting in tmp/to_deply.tgz
61
+
62
+ For those interested, the zip file contains all the source files of the project plus another zip of all the source files of the project. The first level is the context you'll use for doing the local deploy and the inner zip file is what will eventually be deployed :-)
63
+
64
+
65
+ == 2. Copycats
66
+
67
+ * use whatever method is easiest for this. This totally depends on your environment. Either scp or sftp should be fine for the task.
68
+
69
+
70
+ == 3. Unzip and reveal!
71
+
72
+ * the following command should do the trick:
73
+ tar -xvzf to_deploy.tgz
74
+
75
+
76
+ == 4. Deploy baby!
77
+
78
+ * cd into the newly created directory:
79
+ cd to_deploy
80
+
81
+ * run the local deploy task:
82
+ rake acceptance vlad:if:local:deploy
83
+ (note that acceptance should be changed to whatever environment (if any) you specify in config/deploy.rb)
84
+
85
+
86
+ == 5. Time for tea
87
+
88
+ * Make yourself a deserved cup of English tea (with a splash of milk). Please don't be cruel to the English culture and drink Pickwick English Blend though...
89
+
90
+
91
+
49
92
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.7
@@ -0,0 +1,37 @@
1
+ namespace :vlad do
2
+ namespace :if do
3
+
4
+ desc "Perform a full deploy."
5
+ task :deploy => %w[
6
+ vlad:if:maintenance:off
7
+ vlad:if:update
8
+ vlad:if:symlink:shared
9
+ vlad:if:touch:shared_log
10
+ vlad:if:gems:install
11
+ vlad:if:migrate
12
+ vlad:if:update_crontab
13
+ vlad:if:ts:full_reboot
14
+ vlad:if:start
15
+ vlad:if:cleanup
16
+ vlad:if:maintenance:on
17
+ ]
18
+
19
+ namespace :local do
20
+
21
+ desc "Perform a full local deploy."
22
+ task :deploy => %w[
23
+ vlad:if:maintenance:off
24
+ vlad:if:local:update
25
+ vlad:if:symlink:shared
26
+ vlad:if:touch:shared_log
27
+ vlad:if:gems:install
28
+ vlad:if:migrate
29
+ vlad:if:update_crontab
30
+ vlad:if:ts:full_reboot
31
+ vlad:if:start
32
+ vlad:if:cleanup
33
+ vlad:if:maintenance:on
34
+ ]
35
+ end
36
+ end
37
+ end
@@ -3,7 +3,7 @@ namespace :vlad do
3
3
  namespace :gems do
4
4
  desc "Install required gems."
5
5
  remote_task :install, :roles => :app do
6
- run "cd #{current_path} && sudo rake gems:install RAILS_ENV=#{environment}"
6
+ run "cd #{current_path} && sudo rake gems:install --no-rdoc --no-ri RAILS_ENV=#{environment}"
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,4 @@
1
- namespace :vlad do
2
- namespace :if do
1
+ namespace :vlad do namespace :if do
3
2
  namespace :local do
4
3
 
5
4
  desc "Updates your application server to the latest revision stored
@@ -8,15 +7,12 @@ namespace :vlad do
8
7
  remote_task :update, :roles => :app do
9
8
  symlink = false
10
9
  begin
11
- #we need to have local_source_path set
12
- unless local_source_path then
13
- raise "Error, local_source_path not set. Please set local_source_path
14
- to point to the directory you're trying to local deploy from".cleanup
15
- end
16
-
17
10
  run [
18
11
  "mkdir -p #{release_path}",
19
- "cp -R #{local_source_path}/* #{release_path}",
12
+ "cp #{RAILS_ROOT}/tmp/to_deploy.tgz #{release_path}/",
13
+ "cd #{release_path}",
14
+ "tar -xvzf to_deploy.tgz",
15
+ "rm to_deploy.tgz",
20
16
  "chmod -R g+w #{latest_release}",
21
17
  ].join(" && ")
22
18
 
@@ -0,0 +1,28 @@
1
+ namespace :vlad do
2
+ namespace :if do
3
+
4
+ desc "Create a tgz version of this source in tmp/app.tgz"
5
+ task :zip do
6
+ tmp_name = "to_deploy"
7
+ tmp_dir = "/tmp/#{tmp_name}"
8
+ src_name = "#{RAILS_ROOT}/tmp/to_deploy.tgz"
9
+
10
+ sh [
11
+ "rm -rf #{tmp_dir}",
12
+ "mkdir #{tmp_dir}",
13
+ "cp -R #{RAILS_ROOT}/* #{tmp_dir}",
14
+ "rm -rf #{tmp_dir}/.git",
15
+ "cd #{tmp_dir}",
16
+ "tar cf - . | gzip > #{src_name}",
17
+ "rm -rf #{tmp_dir}",
18
+ "mkdir #{tmp_dir}",
19
+ "cp -R #{RAILS_ROOT}/* #{tmp_dir}",
20
+ "rm -rf #{tmp_dir}/.git",
21
+ "cd /tmp",
22
+ "tar cf - #{tmp_name} | gzip > #{src_name}",
23
+ "rm -rf #{tmp_dir}"
24
+ ].join(';')
25
+ puts "Created #{src_name}"
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: if-vlad-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Aaron
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-26 00:00:00 +01:00
13
+ date: 2009-12-31 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -39,6 +39,7 @@ files:
39
39
  - lib/if-vlad-recipes.rb
40
40
  - lib/if-vlad-recipes/cleanup.rb
41
41
  - lib/if-vlad-recipes/current_branch_file.rb
42
+ - lib/if-vlad-recipes/deploy.rb
42
43
  - lib/if-vlad-recipes/gems.rb
43
44
  - lib/if-vlad-recipes/git_with_submodule_support.rb
44
45
  - lib/if-vlad-recipes/maintenance.rb
@@ -50,6 +51,7 @@ files:
50
51
  - lib/if-vlad-recipes/update-from-local.rb
51
52
  - lib/if-vlad-recipes/update.rb
52
53
  - lib/if-vlad-recipes/update_crontab.rb
54
+ - lib/if-vlad-recipes/zip.rb
53
55
  has_rdoc: true
54
56
  homepage: http://github.com/innovationfactory/if-vlad-recipes
55
57
  licenses: []