obs-recipes 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
2
+ :patch: 1
3
3
  :major: 0
4
4
  :minor: 5
@@ -2,7 +2,7 @@ Capistrano::Configuration.instance(:must_exist).load do
2
2
  def upload_monit(name,content)
3
3
  put(content,deploy_to+"/#{name}.monitrc")
4
4
  sudo 'mkdir /etc/monit.d' rescue nil
5
- run "mv #{deploy_to}/#{name}.monitrc /etc/monit.d/"
5
+ sudo "mv #{deploy_to}/#{name}.monitrc /etc/monit.d/"
6
6
  end
7
7
 
8
8
  def monit_reload
@@ -0,0 +1,58 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+ set :rails_version, "2.3.5" unless exists?(:rails_version)
3
+
4
+ def apt_get(packeges)
5
+ sudo("apt-get install #{packeges}")
6
+ end
7
+
8
+ def gem_install(name,version=nil)
9
+ sudo("gem install #{name} #{version.nil? ? '' : "--version=#{version}"} --no-ri --no-rdoc")
10
+ end
11
+
12
+ namespace :packages do
13
+ task :install do
14
+ end
15
+
16
+ namespace :apt do
17
+ task :install do
18
+ sudo("apt-get update")
19
+ apt_get("monit")
20
+ apt_get("subversion git-core")
21
+ end
22
+
23
+ task :ruby, :only=>[:web,:app] do
24
+ apt_get("build-essential gcc-4.2")
25
+ apt_get("ruby-full")
26
+ #todo make rake to work
27
+ end
28
+
29
+ task :mysql_client do
30
+ apt_get("mysql-common mysql-client-5.0")
31
+ apt_get("libmysql-ruby1.8 libmysqlclient16-dev" )
32
+ end
33
+
34
+ task :mysql,:only=>[:db] do
35
+ apt_get("mysql-server-5.0")
36
+ end
37
+
38
+ task :nginx,:only=>[:web] do
39
+ apt_get("nginx")
40
+ end
41
+
42
+ task :apache2,:only=>[:web] do
43
+ apt_get("apache2")
44
+ end
45
+ end
46
+
47
+ namespace :gems do
48
+ task :install,:only=>[:app,:web] do
49
+ sudo("gem sources -a http://gems.github.com")
50
+ sudo("gem sources -a http://gemcutter.org/")
51
+ gem_install("rails",rails_version)
52
+ end
53
+ end
54
+ end
55
+
56
+ after "packages:install","packages:apt:install"
57
+ after "packages:install","packages:gems:install"
58
+ end
@@ -0,0 +1,9 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+ task :authorize_current_machine do
3
+ key=File.read(File.expand_path("~/.ssh/id_rsa.pub"))
4
+ put key,"#{deploy_to}/authorized_keys"
5
+ run "cat #{deploy_to}/authorized_keys >> ~/.ssh/authorized_keys"
6
+ run "rm #{deploy_to}/authorized_keys"
7
+ run("chmod 640 ~/.ssh/authorized_keys")
8
+ end
9
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{obs-recipes}
3
- s.version = "0.5.0"
3
+ s.version = "0.5.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Alexander Petrov"]
@@ -16,7 +16,9 @@ Gem::Specification.new do |s|
16
16
  "lib/helpers.rb",
17
17
  "lib/recipes/monit.rb",
18
18
  "lib/recipes/nginx.rb",
19
+ "lib/recipes/packages.rb",
19
20
  "lib/recipes/rails.rb",
21
+ "lib/recipes/system.rb",
20
22
  "lib/templates/monit/global.erb",
21
23
  "lib/templates/monit/mongrels.erb",
22
24
  "lib/templates/monit/mysql.erb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obs-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Petrov
@@ -38,7 +38,9 @@ files:
38
38
  - lib/helpers.rb
39
39
  - lib/recipes/monit.rb
40
40
  - lib/recipes/nginx.rb
41
+ - lib/recipes/packages.rb
41
42
  - lib/recipes/rails.rb
43
+ - lib/recipes/system.rb
42
44
  - lib/templates/monit/global.erb
43
45
  - lib/templates/monit/mongrels.erb
44
46
  - lib/templates/monit/mysql.erb