Permalink
Browse files

moving stuff around

git-svn-id: http://svn.ducktyper.com/capigen/trunk@60 03f83d6c-b416-495f-9003-0924d19d01a8
  • Loading branch information...
1 parent 397c2b0 commit 70c46b55fa8b86b5c9e238f2072400bb16922875 @gabriel committed Feb 6, 2008
Showing with 4,263 additions and 0 deletions.
  1. +4 −0 History.txt
  2. +20 −0 License.txt
  3. +94 −0 Manifest.txt
  4. +1 −0 README.txt
  5. +70 −0 config/hoe.rb
  6. +17 −0 config/requirements.rb
  7. +17 −0 generators/capistrano/templates/centos/setup.sh
  8. +95 −0 generators/capistrano/templates/centos/sudoers
  9. +20 −0 generators/capistrano/templates/imagemagick/install.sh
  10. +27 −0 generators/capistrano/templates/memcached/install.sh
  11. +70 −0 generators/capistrano/templates/memcached/memcached.initd.centos.erb
  12. +4 −0 generators/capistrano/templates/memcached/memcached.monitrc.erb
  13. +61 −0 generators/capistrano/templates/mongrel/mongrel_cluster.initd.erb
  14. +15 −0 generators/capistrano/templates/mongrel/mongrel_cluster.monitrc.erb
  15. +10 −0 generators/capistrano/templates/mongrel/mongrel_cluster.yml.erb
  16. +14 −0 generators/capistrano/templates/monit/cert.sh
  17. +29 −0 generators/capistrano/templates/monit/install.sh
  18. +34 −0 generators/capistrano/templates/monit/monit.cnf
  19. +68 −0 generators/capistrano/templates/monit/monit.initd.centos.erb
  20. +28 −0 generators/capistrano/templates/monit/monitrc.erb
  21. +15 −0 generators/capistrano/templates/monit/patch_inittab.sh
  22. +10 −0 generators/capistrano/templates/mysql/install.sh.erb
  23. +5 −0 generators/capistrano/templates/mysql/install_db.sql.erb
  24. +6 −0 generators/capistrano/templates/mysql/mysql.monitrc.erb
  25. +42 −0 generators/capistrano/templates/nginx/install.sh.erb
  26. +76 −0 generators/capistrano/templates/nginx/nginx.conf.erb
  27. +62 −0 generators/capistrano/templates/nginx/nginx.initd.erb
  28. +4 −0 generators/capistrano/templates/nginx/nginx.monitrc.erb
  29. +94 −0 generators/capistrano/templates/nginx/nginx_vhost.conf.erb
  30. +42 −0 generators/capistrano/templates/rails/database.yml.erb
  31. +26 −0 generators/capistrano/templates/ruby/ruby_install.sh
  32. +13 −0 generators/capistrano/templates/ruby/rubygems_install.sh
  33. +22 −0 generators/capistrano/templates/sphinx/install.sh.erb
  34. +496 −0 generators/capistrano/templates/sphinx/sphinx.conf.erb
  35. +4 −0 generators/capistrano/templates/sphinx/sphinx.monitrc.erb
  36. +67 −0 generators/capistrano/templates/sphinx/sphinx_app.initd.centos.erb
  37. +57 −0 generators/capistrano/templates/sphinx/sphinx_app.initd.erb
  38. +22 −0 generators/templates/capistrano/Capfile
  39. +63 −0 generators/templates/capistrano/deploy.rb.erb
  40. +4 −0 generators/templates/memcached/install_monit.sh
  41. +8 −0 generators/templates/mysql/install_monit.sh
  42. +8 −0 generators/templates/nginx/install_monit.sh
  43. +15 −0 recipes/gen.rb
  44. +64 −0 recipes/profiles/centos-sick.rb
  45. +14 −0 script/destroy
  46. +14 −0 script/generate
  47. +74 −0 script/txt2html
  48. +1,585 −0 setup.rb
  49. +34 −0 tasks/deployment.rake
  50. +7 −0 tasks/environment.rake
  51. +17 −0 tasks/website.rake
  52. +11 −0 test/test_capigen.rb
  53. +43 −0 test/test_capistrano_generator.rb
  54. +20 −0 test/test_generator_helper.rb
  55. +11 −0 website/index.html
  56. +39 −0 website/index.txt
  57. +285 −0 website/javascripts/rounded_corners_lite.inc.js
  58. +138 −0 website/stylesheets/screen.css
  59. +48 −0 website/template.rhtml
View
@@ -0,0 +1,4 @@
+== 0.0.1 2008-02-06
+
+* 1 major enhancement:
+ * Initial release
View
@@ -0,0 +1,20 @@
+Copyright (c) 2008 FIXME full name
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,94 @@
+Capfile
+History.txt
+License.txt
+Manifest.txt
+README.txt
+Rakefile
+config/hoe.rb
+config/requirements.rb
+doc/Centos.txt
+doc/README
+init.rb
+lib/capigen.rb
+lib/capigen/version.rb
+lib/configr/config.rb
+lib/configr/helper.rb
+lib/configr/helpers/gem_helper.rb
+lib/configr/helpers/package_helper.rb
+lib/configr/helpers/script_helper.rb
+lib/configr/helpers/wget_helper.rb
+lib/configr/packagers/yum.rb
+lib/configr/profiles.rb
+lib/configr/recipes.yml
+lib/configr/templates.rb
+lib/configr/version.rb
+lib/templates/capistrano/Capfile
+lib/templates/capistrano/deploy.rb.erb
+lib/templates/centos/setup.sh
+lib/templates/centos/sudoers
+lib/templates/imagemagick/install.sh
+lib/templates/memcached/install.sh
+lib/templates/memcached/install_monit.sh
+lib/templates/memcached/memcached.initd.centos.erb
+lib/templates/memcached/memcached.monitrc.erb
+lib/templates/mongrel/mongrel_cluster.initd.erb
+lib/templates/mongrel/mongrel_cluster.monitrc.erb
+lib/templates/mongrel/mongrel_cluster.yml.erb
+lib/templates/monit/cert.sh
+lib/templates/monit/install.sh
+lib/templates/monit/monit.cnf
+lib/templates/monit/monit.initd.centos.erb
+lib/templates/monit/monitrc.erb
+lib/templates/monit/patch_inittab.sh
+lib/templates/mysql/install.sh.erb
+lib/templates/mysql/install_db.sql.erb
+lib/templates/mysql/install_monit.sh
+lib/templates/mysql/mysql.monitrc.erb
+lib/templates/nginx/install.sh.erb
+lib/templates/nginx/install_monit.sh
+lib/templates/nginx/nginx.conf.erb
+lib/templates/nginx/nginx.initd.erb
+lib/templates/nginx/nginx.monitrc.erb
+lib/templates/nginx/nginx_vhost.conf.erb
+lib/templates/rails/database.yml.erb
+lib/templates/ruby/ruby_install.sh
+lib/templates/ruby/rubygems_install.sh
+lib/templates/sphinx/install.sh.erb
+lib/templates/sphinx/sphinx.conf.erb
+lib/templates/sphinx/sphinx.monitrc.erb
+lib/templates/sphinx/sphinx_app.initd.centos.erb
+lib/templates/sphinx/sphinx_app.initd.erb
+log/debug.log
+recipes/README
+recipes/bootstrap/patch.rb
+recipes/centos.rb
+recipes/deploy.rb
+recipes/gems.rb
+recipes/gen.rb
+recipes/imagemagick.rb
+recipes/install.rb
+recipes/memcached.rb
+recipes/mongrel_cluster.rb
+recipes/monit.rb
+recipes/mysql.rb
+recipes/nginx.rb
+recipes/profiles/centos-sick.rb
+recipes/rails.rb
+recipes/ruby.rb
+recipes/sphinx.rb
+script/destroy
+script/generate
+script/txt2html
+setup.rb
+tasks/deployment.rake
+tasks/environment.rake
+tasks/website.rake
+test/Capfile
+test/config/configr.yml
+test/test_capigen.rb
+test/test_helper.rb
+website/index.html
+website/index.txt
+website/javascripts/rounded_corners_lite.inc.js
+website/stylesheets/screen.css
+website/template.rhtml
View
@@ -0,0 +1 @@
+README
View
@@ -0,0 +1,70 @@
+require 'capigen/version'
+
+AUTHOR = 'Gabriel Handford' # can also be an array of Authors
+EMAIL = "gabrielh@gmail.com"
+DESCRIPTION = "Capistrano recipe library for all types of remote tasks."
+GEM_NAME = 'capigen' # what ppl will type to install your gem
+RUBYFORGE_PROJECT = 'capigen' # The unix name for your project
+HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
+DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
+
+@config_file = "~/.rubyforge/user-config.yml"
+@config = nil
+RUBYFORGE_USERNAME = "unknown"
+def rubyforge_username
+ unless @config
+ begin
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
+ rescue
+ puts <<-EOS
+ERROR: No rubyforge config file found: #{@config_file}
+Run 'rubyforge setup' to prepare your env for access to Rubyforge
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
+ EOS
+ exit
+ end
+ end
+ RUBYFORGE_USERNAME.replace @config["username"]
+end
+
+
+REV = nil
+# UNCOMMENT IF REQUIRED:
+# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
+VERS = Capigen::VERSION::STRING + (REV ? ".#{REV}" : "")
+RDOC_OPTS = ['--quiet', '--title', 'capigen documentation',
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README",
+ "--inline-source"]
+
+class Hoe
+ def extra_deps
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
+ @extra_deps
+ end
+end
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+hoe = Hoe.new(GEM_NAME, VERS) do |p|
+ p.developer(AUTHOR, EMAIL)
+ p.description = DESCRIPTION
+ p.summary = DESCRIPTION
+ p.url = HOMEPATH
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
+ p.test_globs = ["test/**/test_*.rb"]
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
+
+ # == Optional
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
+
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
+
+end
+
+CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
+PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
+hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
+hoe.rsync_args = '-av --delete --ignore-errors'
View
@@ -0,0 +1,17 @@
+require 'fileutils'
+include FileUtils
+
+require 'rubygems'
+%w[rake hoe newgem rubigen].each do |req_gem|
+ begin
+ require req_gem
+ rescue LoadError
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
+ puts "Installation: gem install #{req_gem} -y"
+ exit
+ end
+end
+
+$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
+
+require 'capigen'
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+trap ERROR ERR
+
+# Add admin group
+cat /etc/group | grep admin || /usr/sbin/groupadd admin
+
+# Install sudoers
+install -o root -m 440 /tmp/sudoers /etc/sudoers
+
+# Change inittab to runlevel 3
+sed -i -e 's/^id:5:initdefault:/id:3:initdefault:/g' /etc/inittab
+
+
+# Create web apps directory
+mkdir -p /var/www/apps
@@ -0,0 +1,95 @@
+## Sudoers allows particular users to run various commands as
+## the root user, without needing the root password.
+##
+## Examples are provided at the bottom of the file for collections
+## of related commands, which can then be delegated out to particular
+## users or groups.
+##
+## This file must be edited with the 'visudo' command.
+
+## Host Aliases
+## Groups of machines. You may prefer to use hostnames (perhap using
+## wildcards for entire domains) or IP addresses instead.
+# Host_Alias FILESERVERS = fs1, fs2
+# Host_Alias MAILSERVERS = smtp, smtp2
+
+## User Aliases
+## These aren't often necessary, as you can use regular groups
+## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
+## rather than USERALIAS
+# User_Alias ADMINS = jsmith, mikem
+
+
+## Command Aliases
+## These are groups of related commands...
+
+## Networking
+Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool
+
+## Installation and management of software
+Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum
+
+## Services
+Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig
+
+## Updating the locate database
+Cmnd_Alias LOCATE = /usr/sbin/updatedb
+
+## Storage
+Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount
+
+## Delegating permissions
+Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp
+
+## Processes
+Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
+
+## Drivers
+Cmnd_Alias DRIVERS = /sbin/modprobe
+
+# Defaults specification
+
+#
+# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
+# You have to run "ssh -t hostname sudo <cmd>".
+#
+#Defaults requiretty
+
+Defaults env_reset
+Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
+ LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
+ LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
+ LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
+ _XKB_CHARSET XAUTHORITY"
+
+## Next comes the main part: which users can run what software on
+## which machines (the sudoers file can be shared between multiple
+## systems).
+## Syntax:
+##
+## user MACHINE=COMMANDS
+##
+## The COMMANDS section may have other options added to it.
+##
+## Allow root to run any commands anywhere
+root ALL=(ALL) ALL
+%admin ALL=(ALL) ALL
+
+## Allows members of the 'sys' group to run networking, software,
+## service management apps and more.
+# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
+
+## Allows people in group wheel to run all commands
+# %wheel ALL=(ALL) ALL
+
+## Same thing without a password
+# %wheel ALL=(ALL) NOPASSWD: ALL
+
+## Allows members of the users group to mount and unmount the
+## cdrom as root
+# %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
+
+## Allows members of the users group to shutdown this system
+# %users localhost=/sbin/shutdown -h now
+
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+set -e
+trap ERROR ERR
+
+cd /tmp
+
+wget -nv ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
+
+tar zxpf ImageMagick.tar.gz
+cd ImageMagick-*
+echo "Configuring ImageMagick..."
+./configure > configure.log
+echo "Compiling ImageMagick..."
+make > make.log
+echo "Installing ImageMagick..."
+make install > make_install.log
+
+cd ..
+rm -rf ImageMagick*
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+trap ERROR ERR
+
+cd /tmp
+
+wget -nv http://www.danga.com/memcached/dist/memcached-1.2.4.tar.gz
+
+tar zxpf memcached-1.2.4.tar.gz
+
+cd memcached-1.2.4
+echo "Configuring memcached..."
+./configure --prefix=/usr/local > configure.log
+echo "Compiling memcached..."
+make > make.log
+echo "Installing memcached..."
+make install > make_install.log
+
+cd ..
+rm -rf memcached-1.2.4*
+
+install -o root /tmp/memcached.initd /etc/init.d/memcached
+rm -f /tmp/memcached.initd
+/sbin/chkconfig --level 345 memcached on
+
+
Oops, something went wrong.

0 comments on commit 70c46b5

Please sign in to comment.