chrisrec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +2 -0
- data/README +1 -0
- data/Rakefile +8 -1
- data/chrisrec.gemspec +6 -6
- data/lib/chrisrec.rb +1 -0
- data/lib/jekyll/jekyll.rb +92 -0
- data/lib/tomcat/tomcat.rb +4 -2
- data/template/jekyll/httpd-vhost-jekyll.conf.erb +16 -0
- metadata +12 -4
data/Manifest
CHANGED
@@ -6,6 +6,7 @@ lib/chrisrec.rb
|
|
6
6
|
lib/console/console.rb
|
7
7
|
lib/daemon/daemon.rb
|
8
8
|
lib/gitosis/gitosis.rb
|
9
|
+
lib/jekyll/jekyll.rb
|
9
10
|
lib/memcached/memcached.rb
|
10
11
|
lib/munin/munin.rb
|
11
12
|
lib/mysql/mysql.rake
|
@@ -17,6 +18,7 @@ lib/tomcat/tomcat.rb
|
|
17
18
|
lib/workling/workling.rb
|
18
19
|
template/daemon/daemon-init-script.erb
|
19
20
|
template/daemon/monit.conf.erb
|
21
|
+
template/jekyll/httpd-vhost-jekyll.conf.erb
|
20
22
|
template/memcached/memcached-conf.erb
|
21
23
|
template/memcached/memcached.erb
|
22
24
|
template/memcached/monit.conf.erb
|
data/README
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
==EXTENSIONS FOR DEPREC
|
data/Rakefile
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
## rake manifest
|
2
|
+
## rake gem
|
3
|
+
## sudo rake install
|
4
|
+
|
5
|
+
## rake package
|
6
|
+
## gem push pkg/chrisrec-0.1.0.gem
|
7
|
+
|
1
8
|
# Rakefile
|
2
9
|
require 'rubygems'
|
3
10
|
require 'rake'
|
4
11
|
require 'echoe'
|
5
12
|
|
6
|
-
Echoe.new('chrisrec', '0.1.
|
13
|
+
Echoe.new('chrisrec', '0.1.1') do |p|
|
7
14
|
p.description = "Extend Deprec with other recipies."
|
8
15
|
p.url = "http://github.com/dougochris/chrisrec"
|
9
16
|
p.author = "Chris Douglas"
|
data/chrisrec.gemspec
CHANGED
@@ -2,27 +2,27 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{chrisrec}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Chris Douglas"]
|
9
|
-
s.date = %q{2010-
|
9
|
+
s.date = %q{2010-06-15}
|
10
10
|
s.description = %q{Extend Deprec with other recipies.}
|
11
11
|
s.email = %q{dougo.chris@gmail.com}
|
12
|
-
s.extra_rdoc_files = ["README", "lib/backgroundrb/backgroundrb.rb", "lib/chrisrec.rb", "lib/console/console.rb", "lib/daemon/daemon.rb", "lib/gitosis/gitosis.rb", "lib/memcached/memcached.rb", "lib/munin/munin.rb", "lib/mysql/mysql.rake", "lib/mysql/mysql.rb", "lib/rake/rake.rb", "lib/rakecron/rakecron.rb", "lib/starling/starling.rb", "lib/tomcat/tomcat.rb", "lib/workling/workling.rb"]
|
13
|
-
s.files = ["Manifest", "README", "Rakefile", "lib/backgroundrb/backgroundrb.rb", "lib/chrisrec.rb", "lib/console/console.rb", "lib/daemon/daemon.rb", "lib/gitosis/gitosis.rb", "lib/memcached/memcached.rb", "lib/munin/munin.rb", "lib/mysql/mysql.rake", "lib/mysql/mysql.rb", "lib/rake/rake.rb", "lib/rakecron/rakecron.rb", "lib/starling/starling.rb", "lib/tomcat/tomcat.rb", "lib/workling/workling.rb", "template/daemon/daemon-init-script.erb", "template/daemon/monit.conf.erb", "template/memcached/memcached-conf.erb", "template/memcached/memcached.erb", "template/memcached/monit.conf.erb", "template/memcached/start-memcached.erb", "template/munin/httpd-vhost-munin.conf.erb", "template/munin/munin.conf.erb", "template/munin/munin_nginx_vhost.conf.erb", "template/rakecron/rakecron.erb", "template/starling/monit.conf.erb", "template/starling/starling-init-script.erb", "template/tomcat/conf/server.xml.erb", "template/tomcat/conf/web.xml", "template/tomcat/logs/empty.txt", "template/tomcat/monit.conf.erb", "template/tomcat/temp/empty.txt", "template/tomcat/tomcat.erb", "template/tomcat/webapps/empty.txt", "template/tomcat/work/empty.txt", "template/workling/monit.conf.erb", "template/workling/workling-init-script.erb", "chrisrec.gemspec"]
|
12
|
+
s.extra_rdoc_files = ["README", "lib/backgroundrb/backgroundrb.rb", "lib/chrisrec.rb", "lib/console/console.rb", "lib/daemon/daemon.rb", "lib/gitosis/gitosis.rb", "lib/jekyll/jekyll.rb", "lib/memcached/memcached.rb", "lib/munin/munin.rb", "lib/mysql/mysql.rake", "lib/mysql/mysql.rb", "lib/rake/rake.rb", "lib/rakecron/rakecron.rb", "lib/starling/starling.rb", "lib/tomcat/tomcat.rb", "lib/workling/workling.rb"]
|
13
|
+
s.files = ["Manifest", "README", "Rakefile", "lib/backgroundrb/backgroundrb.rb", "lib/chrisrec.rb", "lib/console/console.rb", "lib/daemon/daemon.rb", "lib/gitosis/gitosis.rb", "lib/jekyll/jekyll.rb", "lib/memcached/memcached.rb", "lib/munin/munin.rb", "lib/mysql/mysql.rake", "lib/mysql/mysql.rb", "lib/rake/rake.rb", "lib/rakecron/rakecron.rb", "lib/starling/starling.rb", "lib/tomcat/tomcat.rb", "lib/workling/workling.rb", "template/daemon/daemon-init-script.erb", "template/daemon/monit.conf.erb", "template/jekyll/httpd-vhost-jekyll.conf.erb", "template/memcached/memcached-conf.erb", "template/memcached/memcached.erb", "template/memcached/monit.conf.erb", "template/memcached/start-memcached.erb", "template/munin/httpd-vhost-munin.conf.erb", "template/munin/munin.conf.erb", "template/munin/munin_nginx_vhost.conf.erb", "template/rakecron/rakecron.erb", "template/starling/monit.conf.erb", "template/starling/starling-init-script.erb", "template/tomcat/conf/server.xml.erb", "template/tomcat/conf/web.xml", "template/tomcat/logs/empty.txt", "template/tomcat/monit.conf.erb", "template/tomcat/temp/empty.txt", "template/tomcat/tomcat.erb", "template/tomcat/webapps/empty.txt", "template/tomcat/work/empty.txt", "template/workling/monit.conf.erb", "template/workling/workling-init-script.erb", "chrisrec.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/dougochris/chrisrec}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Chrisrec", "--main", "README"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = %q{chrisrec}
|
18
|
-
s.rubygems_version = %q{1.3.
|
18
|
+
s.rubygems_version = %q{1.3.7}
|
19
19
|
s.summary = %q{Extend Deprec with other recipies.}
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
23
|
s.specification_version = 3
|
24
24
|
|
25
|
-
if Gem::Version.new(Gem::
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
26
|
else
|
27
27
|
end
|
28
28
|
else
|
data/lib/chrisrec.rb
CHANGED
@@ -10,3 +10,4 @@ require "#{File.dirname(__FILE__)}/memcached/memcached.rb"
|
|
10
10
|
require "#{File.dirname(__FILE__)}/daemon/daemon.rb"
|
11
11
|
require "#{File.dirname(__FILE__)}/tomcat/tomcat.rb"
|
12
12
|
require "#{File.dirname(__FILE__)}/console/console.rb"
|
13
|
+
require "#{File.dirname(__FILE__)}/jekyll/jekyll.rb"
|
@@ -0,0 +1,92 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
namespace :chrisrec do
|
3
|
+
namespace :jekyll do
|
4
|
+
|
5
|
+
set :tomcat_address, '127.0.0.1'
|
6
|
+
set :tomcat_port, 8080
|
7
|
+
set :tomcat_shutdown_port, 8009
|
8
|
+
set :tomcat_ssl_port, 8443
|
9
|
+
|
10
|
+
set :local_template_dir, "#{File.dirname(__FILE__)}/../../template"
|
11
|
+
|
12
|
+
desc "Install jekyll"
|
13
|
+
task :install, :roles => :app do
|
14
|
+
gem2.install('jekyll')
|
15
|
+
top.deprec.rails.setup_user_perms
|
16
|
+
top.deprec.rails.create_app_user_and_group
|
17
|
+
top.deprec.rails.setup_paths
|
18
|
+
top.deprec.rails.setup_shared_dirs
|
19
|
+
|
20
|
+
top.chrisrec.jekyll.deploy.setup
|
21
|
+
end
|
22
|
+
|
23
|
+
PROJECT_CONFIG_FILES[:jekyll] = [
|
24
|
+
|
25
|
+
{:template => "httpd-vhost-jekyll.conf.erb",
|
26
|
+
:path => 'conf/httpd-vhost-jekyll.conf',
|
27
|
+
:mode => 0755,
|
28
|
+
:owner => 'root:root'}
|
29
|
+
]
|
30
|
+
|
31
|
+
|
32
|
+
desc "Generate configuration file(s) for jekyll from template(s)"
|
33
|
+
task :config_gen do
|
34
|
+
PROJECT_CONFIG_FILES[:jekyll].each do |file|
|
35
|
+
deprec2.render_template(:jekyll, file)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Deploy configuration files(s) for jekyll'
|
40
|
+
task :config, :roles => :web do
|
41
|
+
deprec2.push_configs(:jekyll, PROJECT_CONFIG_FILES[:jekyll])
|
42
|
+
symlink_apache_vhost
|
43
|
+
|
44
|
+
top.deprec.apache.restart
|
45
|
+
end
|
46
|
+
|
47
|
+
task :symlink_apache_vhost, :roles => :web do
|
48
|
+
sudo "ln -sf #{deploy_to}/jekyll/conf/httpd-vhost-jekyll.conf /etc/apache2/sites-available/jekyll"
|
49
|
+
sudo "ln -sf #{deploy_to}/jekyll/conf/httpd-vhost-jekyll.conf /etc/apache2/sites-enabled/jekyll"
|
50
|
+
end
|
51
|
+
|
52
|
+
namespace :deploy do
|
53
|
+
desc 'deploy'
|
54
|
+
task :default do
|
55
|
+
strategy.deploy!
|
56
|
+
|
57
|
+
if ruby_vm_type.to_s == 'ree'
|
58
|
+
run "cd #{latest_release} && env PATH=#{ree_install_dir}/bin:$PATH #{ree_install_dir}/bin/jekyll #{latest_release}/_site"
|
59
|
+
else
|
60
|
+
run "cd #{latest_release} && jekyll #{latest_release}/_site"
|
61
|
+
end
|
62
|
+
|
63
|
+
run "rm -f #{current_path} && ln -s #{latest_release}/_site #{current_path}"
|
64
|
+
|
65
|
+
top.deprec.apache.restart
|
66
|
+
end
|
67
|
+
|
68
|
+
desc 'setup'
|
69
|
+
task :setup do
|
70
|
+
dirs = [deploy_to, releases_path]
|
71
|
+
sudo "mkdir -p #{dirs.join(' ')}"
|
72
|
+
sudo "chgrp -R #{group} #{dirs.join(' ')}"
|
73
|
+
sudo "chmod g+w #{dirs.join(' ')}"
|
74
|
+
end
|
75
|
+
|
76
|
+
desc 'rollback'
|
77
|
+
task :rollback do
|
78
|
+
if previous_release
|
79
|
+
run "rm #{current_path}; ln -s #{previous_release} #{current_path}"
|
80
|
+
else
|
81
|
+
abort "could not rollback the code because there is no prior release"
|
82
|
+
end
|
83
|
+
|
84
|
+
run "if [ `readlink #{current_path}` != #{current_release} ]; then rm -rf #{current_release}; fi"
|
85
|
+
|
86
|
+
top.deprec.apache.restart
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
data/lib/tomcat/tomcat.rb
CHANGED
@@ -40,6 +40,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
40
40
|
apt.update
|
41
41
|
apt.install( {:base => %w(maven2)}, :stable )
|
42
42
|
|
43
|
+
top.chrisrec.tomcat.deploy.setup
|
44
|
+
|
43
45
|
puts "*******************"
|
44
46
|
puts "*******************"
|
45
47
|
puts "******************* cannot automate the sun java install"
|
@@ -148,7 +150,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
148
150
|
task :default do
|
149
151
|
strategy.deploy!
|
150
152
|
|
151
|
-
top.chrisrec.tomcat.stop
|
153
|
+
top.chrisrec.tomcat.stop
|
152
154
|
|
153
155
|
run "rm -f #{current_path} && ln -s #{latest_release} #{current_path}"
|
154
156
|
if dependent_projects
|
@@ -191,7 +193,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
191
193
|
|
192
194
|
run "if [ `readlink #{current_path}` != #{current_release} ]; then rm -rf #{current_release}; fi"
|
193
195
|
|
194
|
-
top.chrisrec.
|
196
|
+
top.chrisrec.tomcat.restart
|
195
197
|
end
|
196
198
|
end
|
197
199
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Listen 9080
|
2
|
+
<VirtualHost *:9080>
|
3
|
+
ServerName <%= domain %>
|
4
|
+
|
5
|
+
DocumentRoot <%= "#{deploy_to}/current" %>
|
6
|
+
|
7
|
+
<Directory <%= "#{deploy_to}/current" %>>
|
8
|
+
Options Indexes FollowSymLinks MultiViews
|
9
|
+
AllowOverride None
|
10
|
+
Order allow,deny
|
11
|
+
allow from all
|
12
|
+
</Directory>
|
13
|
+
|
14
|
+
ErrorLog /var/log/jekyll_log
|
15
|
+
CustomLog /var/log/jekyll-access_log combined
|
16
|
+
</VirtualHost>
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chrisrec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Chris Douglas
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-06-15 00:00:00 +10:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -31,6 +32,7 @@ extra_rdoc_files:
|
|
31
32
|
- lib/console/console.rb
|
32
33
|
- lib/daemon/daemon.rb
|
33
34
|
- lib/gitosis/gitosis.rb
|
35
|
+
- lib/jekyll/jekyll.rb
|
34
36
|
- lib/memcached/memcached.rb
|
35
37
|
- lib/munin/munin.rb
|
36
38
|
- lib/mysql/mysql.rake
|
@@ -49,6 +51,7 @@ files:
|
|
49
51
|
- lib/console/console.rb
|
50
52
|
- lib/daemon/daemon.rb
|
51
53
|
- lib/gitosis/gitosis.rb
|
54
|
+
- lib/jekyll/jekyll.rb
|
52
55
|
- lib/memcached/memcached.rb
|
53
56
|
- lib/munin/munin.rb
|
54
57
|
- lib/mysql/mysql.rake
|
@@ -60,6 +63,7 @@ files:
|
|
60
63
|
- lib/workling/workling.rb
|
61
64
|
- template/daemon/daemon-init-script.erb
|
62
65
|
- template/daemon/monit.conf.erb
|
66
|
+
- template/jekyll/httpd-vhost-jekyll.conf.erb
|
63
67
|
- template/memcached/memcached-conf.erb
|
64
68
|
- template/memcached/memcached.erb
|
65
69
|
- template/memcached/monit.conf.erb
|
@@ -96,16 +100,20 @@ rdoc_options:
|
|
96
100
|
require_paths:
|
97
101
|
- lib
|
98
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
99
104
|
requirements:
|
100
105
|
- - ">="
|
101
106
|
- !ruby/object:Gem::Version
|
107
|
+
hash: 3
|
102
108
|
segments:
|
103
109
|
- 0
|
104
110
|
version: "0"
|
105
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
106
113
|
requirements:
|
107
114
|
- - ">="
|
108
115
|
- !ruby/object:Gem::Version
|
116
|
+
hash: 11
|
109
117
|
segments:
|
110
118
|
- 1
|
111
119
|
- 2
|
@@ -113,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
121
|
requirements: []
|
114
122
|
|
115
123
|
rubyforge_project: chrisrec
|
116
|
-
rubygems_version: 1.3.
|
124
|
+
rubygems_version: 1.3.7
|
117
125
|
signing_key:
|
118
126
|
specification_version: 3
|
119
127
|
summary: Extend Deprec with other recipies.
|