cap-recipes 0.3.30 → 0.3.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,7 @@ Currently included recipes in this gem:
23
23
  * DelayedJob Worker
24
24
  * Whenever Cron Scheduling
25
25
  * Aptitude Package Management
26
+ * Gitosis Git Repository Hosting
26
27
 
27
28
  Check out the USAGE section below for specific tasks included in the recipes.
28
29
 
@@ -45,7 +46,8 @@ Then, include into your @deploy.rb@ configuration file for Capistrano:
45
46
  require 'cap_recipes/tasks/memcache'
46
47
  require 'cap_recipes/tasks/passenger'
47
48
  require 'cap_recipes/tasks/thinking_sphinx'
48
- # or ruby, rubygems, rails, apache, delayed_job, juggernaut, backgroundrb, aptitude, whenever
49
+ require 'cap_recipes/tasks/rails'
50
+ # or ruby, rubygems, apache, delayed_job, juggernaut, backgroundrb, aptitude, gitosis, whenever
49
51
 
50
52
  # OR
51
53
  # only use managing tasks:
@@ -315,6 +317,20 @@ hooks.rb
315
317
  after "deploy:restart", "memcache:restart" # clear cache after updating code
316
318
  </code></pre>
317
319
 
320
+ h3. Gitosis
321
+
322
+ These recipes are for installing Gitosis Git Repository Hosting
323
+
324
+ h4. Configuration
325
+
326
+ * None required
327
+
328
+ h4. Tasks
329
+
330
+ install.rb
331
+
332
+ * gitosis:install
333
+
318
334
  h3. Whenever
319
335
 
320
336
  These recipes are for managing whenever cron job scheduling
@@ -421,6 +437,12 @@ to browse all available utility methods. A few are listed below:
421
437
  * utilities.with_credentials(:user => 'jsmith', :password => 'secret') { ... }
422
438
  ** Forces tasks in block to execute using the given user/password credentials
423
439
  ** This is useful because of certain limitations in capistrano
440
+
441
+ h2. CONTRIBUTERS
442
+
443
+ * nesquena [Nathan Esquenazi] - created and maintaining the library
444
+ * achiu [Arthur Chiu] - contributed gitosis, ruby and other recipes
445
+ * hubertlepicki - contributed thinking_sphinx recipes
424
446
 
425
447
  h2. LICENSE:
426
448
 
@@ -1,4 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 3
4
- :patch: 30
4
+ :build:
5
+ :patch: 32
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cap-recipes}
8
- s.version = "0.3.30"
8
+ s.version = "0.3.32"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi"]
12
- s.date = %q{2009-10-18}
12
+ s.date = %q{2009-10-22}
13
13
  s.description = %q{Battle-tested capistrano recipes for debian, passenger, apache, delayed_job, juggernaut, rubygems, backgroundrb, rails and more}
14
14
  s.email = %q{nesquena@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -39,6 +39,8 @@ Gem::Specification.new do |s|
39
39
  "lib/cap_recipes/tasks/delayed_job.rb",
40
40
  "lib/cap_recipes/tasks/delayed_job/hooks.rb",
41
41
  "lib/cap_recipes/tasks/delayed_job/manage.rb",
42
+ "lib/cap_recipes/tasks/gitosis.rb",
43
+ "lib/cap_recipes/tasks/gitosis/install.rb",
42
44
  "lib/cap_recipes/tasks/juggernaut.rb",
43
45
  "lib/cap_recipes/tasks/juggernaut/hooks.rb",
44
46
  "lib/cap_recipes/tasks/juggernaut/manage.rb",
@@ -96,3 +98,4 @@ Gem::Specification.new do |s|
96
98
  else
97
99
  end
98
100
  end
101
+
@@ -0,0 +1 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'gitosis/*.rb')].sort.each { |lib| require lib }
@@ -0,0 +1,58 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../utilities')
2
+
3
+ Capistrano::Configuration.instance(true).load do
4
+
5
+ namespace :gitosis do
6
+ desc "install Gitosis"
7
+ task :install do
8
+ gitosis.install_packages
9
+ gitosis.setup_packages
10
+ gitosis.setup_git_user
11
+ gitosis.copy_ssh
12
+ gitosis.set_permissions
13
+ end
14
+
15
+ desc "install all necessary packages"
16
+ task :install_packages do
17
+ utilities.apt_install %[git-core python-setuptools]
18
+ end
19
+ before "gitosis:install_packages", "aptitude:updates"
20
+
21
+ desc "setup packages"
22
+ task :setup_packages do
23
+ run "mkdir -p ~/src"
24
+ run "cd ~/src; git clone git://eagain.net/gitosis.git"
25
+ run "cd ~/src/gitosis; #{sudo} python setup.py install"
26
+ end
27
+
28
+ desc "setup git user"
29
+ task :setup_git_user do
30
+ sudo "adduser --system --shell /bin/sh --gecos \'git version control\' --group --disabled-password --home /home/git git"
31
+ end
32
+
33
+ desc "generate ssh key"
34
+ task :generate_ssh do
35
+ run "rm -f /home/#{user}/.ssh/id_rsa; rm -f /home/#{user}/.ssh/id_rsa.pub"
36
+ run "ssh-keygen -q -f /home/#{user}/.ssh/id_rsa -N \"\""
37
+ end
38
+ before "gitosis:copy_ssh", "gitosis:generate_ssh"
39
+
40
+ desc "copy over servers own ssh, important for self pull"
41
+ task :copy_ssh do
42
+ run "sudo -H -u git gitosis-init < /home/#{user}/.ssh/id_rsa.pub"
43
+ end
44
+
45
+ desc "set permissions"
46
+ task :set_permissions do
47
+ sudo "chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update"
48
+ end
49
+
50
+ desc "cleanup the files"
51
+ task :cleanup do
52
+ sudo "rm -rf src"
53
+ end
54
+ before "gitosis:setup_packages", "gitosis:cleanup"
55
+ after "gitosis:setup_packages", "gitosis:cleanup"
56
+
57
+ end
58
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.30
4
+ version: 0.3.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-18 00:00:00 -07:00
12
+ date: 2009-10-22 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -45,6 +45,8 @@ files:
45
45
  - lib/cap_recipes/tasks/delayed_job.rb
46
46
  - lib/cap_recipes/tasks/delayed_job/hooks.rb
47
47
  - lib/cap_recipes/tasks/delayed_job/manage.rb
48
+ - lib/cap_recipes/tasks/gitosis.rb
49
+ - lib/cap_recipes/tasks/gitosis/install.rb
48
50
  - lib/cap_recipes/tasks/juggernaut.rb
49
51
  - lib/cap_recipes/tasks/juggernaut/hooks.rb
50
52
  - lib/cap_recipes/tasks/juggernaut/manage.rb