deprec 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/lib/deprec/recipes.rb +1 -0
- data/lib/deprec/recipes/app/passenger.rb +1 -0
- data/lib/deprec/recipes/integrity.rb +105 -0
- data/lib/deprec/templates/integrity/apache_vhost.erb +4 -0
- data/lib/deprec/templates/integrity/config.ru.erb +21 -0
- data/lib/deprec/templates/integrity/config.yml.erb +43 -0
- metadata +7 -2
data/CHANGELOG
CHANGED
data/lib/deprec/recipes.rb
CHANGED
@@ -19,6 +19,7 @@ require "#{File.dirname(__FILE__)}/recipes/web/nginx"
|
|
19
19
|
require "#{File.dirname(__FILE__)}/recipes/git"
|
20
20
|
require "#{File.dirname(__FILE__)}/recipes/gitosis"
|
21
21
|
require "#{File.dirname(__FILE__)}/recipes/svn"
|
22
|
+
require "#{File.dirname(__FILE__)}/recipes/integrity"
|
22
23
|
|
23
24
|
require "#{File.dirname(__FILE__)}/recipes/users"
|
24
25
|
require "#{File.dirname(__FILE__)}/recipes/ssh"
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'sha1'
|
2
|
+
|
3
|
+
# Copyright 2006-2009 by Mike Bailey. All rights reserved.
|
4
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
5
|
+
namespace :deprec do
|
6
|
+
namespace :integrity do
|
7
|
+
|
8
|
+
set :integrity_install_dir, '/opt/apps/integrity'
|
9
|
+
set(:integrity_domain) do
|
10
|
+
Capistrano::CLI.ui.ask 'Please enter domain name' do |q|
|
11
|
+
q.default = 'integrity.failmode.com'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
set :integrity_use_basic_auth, true
|
15
|
+
set :integrity_hash_admin_password, true
|
16
|
+
set(:integrity_admin_username) do
|
17
|
+
Capistrano::CLI.ui.ask 'Please enter admin username' do |q|
|
18
|
+
q.default = 'admin'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
set(:integrity_admin_password) { Capistrano::CLI.password_prompt 'Please enter admin password' }
|
22
|
+
set :integrity_user, 'integrity'
|
23
|
+
|
24
|
+
|
25
|
+
desc "Install Integrity"
|
26
|
+
task :install, :roles => :ci do
|
27
|
+
install_deps
|
28
|
+
sudo 'gem sources -a http://gems.github.com'
|
29
|
+
gem2.install 'foca-integrity'
|
30
|
+
|
31
|
+
sudo "integrity install --passenger #{integrity_install_dir}"
|
32
|
+
deprec2.useradd 'integrity'
|
33
|
+
sudo "chown -R #{integrity_user} #{integrity_install_dir}"
|
34
|
+
end
|
35
|
+
|
36
|
+
# Install dependencies for Integrity
|
37
|
+
task :install_deps, :roles => :ci do
|
38
|
+
apt.install( {:base => %w(sqlite3 libsqlite3-dev git)}, :stable )
|
39
|
+
gem2.install 'sqlite3-ruby'
|
40
|
+
gem2.install 'do_sqlite3'
|
41
|
+
end
|
42
|
+
|
43
|
+
SYSTEM_CONFIG_FILES[:integrity] = [
|
44
|
+
|
45
|
+
{ :template => 'apache_vhost.erb',
|
46
|
+
:path => "/etc/apache2/sites-available/integrity",
|
47
|
+
:mode => 0755,
|
48
|
+
:owner => 'root:root'},
|
49
|
+
|
50
|
+
{ :template => 'config.ru.erb',
|
51
|
+
:path => "/opt/apps/integrity/config.ru", # XXX shouldn't be hard coded
|
52
|
+
:mode => 0755,
|
53
|
+
:owner => 'root:root'},
|
54
|
+
|
55
|
+
{ :template => 'config.yml.erb',
|
56
|
+
:path => "/opt/apps/integrity/config.yml", # XXX shouldn't be hard coded
|
57
|
+
:mode => 0755,
|
58
|
+
:owner => 'root:root'}
|
59
|
+
|
60
|
+
]
|
61
|
+
|
62
|
+
desc "Generate Integrity apache configs (system & project level)."
|
63
|
+
task :config_gen do
|
64
|
+
SYSTEM_CONFIG_FILES[:integrity].each do |file|
|
65
|
+
deprec2.render_template(:integrity, file)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
desc "Push Integrity config files (system & project level) to server"
|
70
|
+
task :config, :roles => :ci do
|
71
|
+
deprec2.push_configs(:integrity, SYSTEM_CONFIG_FILES[:integrity])
|
72
|
+
sudo "chown #{integrity_user} #{integrity_install_dir}/config.ru"
|
73
|
+
end
|
74
|
+
|
75
|
+
# XXX Setup database for testing project
|
76
|
+
#
|
77
|
+
# $ mysql -uroot p
|
78
|
+
# mysql> CREATE USER integrity INDENTIFIED BY PASSWORD 'mypassword123';
|
79
|
+
# mysql> CREATE DATABASE my_cool_application_test;
|
80
|
+
# mysql> GRANT ALL ON my_cool_application_test.* TO 'integrity'@localhost IDENTIFIED BY 'mypassword123';
|
81
|
+
|
82
|
+
task :activate, :roles => :ci do
|
83
|
+
sudo "a2ensite integrity"
|
84
|
+
top.deprec.web.reload
|
85
|
+
end
|
86
|
+
|
87
|
+
task :deactivate, :roles => :ci do
|
88
|
+
sudo "a2dissite integrity"
|
89
|
+
top.deprec.web.reload
|
90
|
+
end
|
91
|
+
|
92
|
+
desc "Restart Application"
|
93
|
+
task :restart, :roles => :ci do
|
94
|
+
sudo "touch #{integrity_install_dir}/tmp/restart.txt"
|
95
|
+
end
|
96
|
+
|
97
|
+
desc "Restart Apache"
|
98
|
+
task :restart_apache, :roles => :ci do
|
99
|
+
run "#{sudo} /etc/init.d/apache2 restart"
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "integrity"
|
4
|
+
|
5
|
+
# If you want to add any notifiers, install the gems and then require them here
|
6
|
+
# For example, to enable the Email notifier: install the gem (from github:
|
7
|
+
#
|
8
|
+
# sudo gem install -s http://gems.github.com foca-integrity-email
|
9
|
+
#
|
10
|
+
# And then uncomment the following line:
|
11
|
+
#
|
12
|
+
# require "notifier/email"
|
13
|
+
|
14
|
+
# Load configuration and initialize Integrity
|
15
|
+
Integrity.new(File.dirname(__FILE__) + "/config.yml")
|
16
|
+
|
17
|
+
# You probably don't want to edit anything below
|
18
|
+
Integrity::App.set :environment, ENV["RACK_ENV"] || :production
|
19
|
+
Integrity::App.set :port, 8910
|
20
|
+
|
21
|
+
run Integrity::App
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Domain where integrity will be running from. This is used to have
|
2
|
+
# nice URLs in your notifications.
|
3
|
+
# For example:
|
4
|
+
# http://builder.integrityapp.com
|
5
|
+
:base_uri: http://<%= integrity_domain %>
|
6
|
+
|
7
|
+
# This should be a complete connection string to your database.
|
8
|
+
#
|
9
|
+
# Examples:
|
10
|
+
# * `mysql://user:password@localhost/integrity`
|
11
|
+
# * `postgres://user:password@localhost/integrity`
|
12
|
+
# * `sqlite3:///home/integrity/db/integrity.sqlite`
|
13
|
+
#
|
14
|
+
# Note:
|
15
|
+
# * The appropriate data_objects adapter must be installed (`do_mysql`, etc)
|
16
|
+
# * You must create the `integrity` database on localhost, of course.
|
17
|
+
:database_uri: sqlite3:///<%= integrity_install_dir %>/integrity.db
|
18
|
+
|
19
|
+
# This is where your project's code will be checked out to. Make sure it's
|
20
|
+
# writable by the user that runs Integrity.
|
21
|
+
:export_directory: <%= integrity_install_dir %>/builds
|
22
|
+
|
23
|
+
# Path to the integrity log file
|
24
|
+
:log: <%= integrity_install_dir %>/log/integrity.log
|
25
|
+
|
26
|
+
# Enable or disable HTTP authentication for the app. BE AWARE that if you
|
27
|
+
# disable this anyone can delete and alter projects, so do it only if your
|
28
|
+
# app is running in a controlled environment (ie, behind your company's
|
29
|
+
# firewall.)
|
30
|
+
:use_basic_auth: <%= integrity_use_basic_auth %>
|
31
|
+
|
32
|
+
<%- if integrity_use_basic_auth -%>
|
33
|
+
# When `use_basic_auth` is true, the admin's username for HTTP authentication.
|
34
|
+
:admin_username: <%= integrity_admin_username %>
|
35
|
+
|
36
|
+
# When `use_basic_auth` is true, the admin's password. Usually saved as a
|
37
|
+
# SHA1 hash. See the next option.
|
38
|
+
:admin_password: <%= integrity_hash_admin_password ? SHA1::hexdigest(integrity_admin_password) : integrity_admin_password %>
|
39
|
+
|
40
|
+
# If this is true, then whenever we authenticate the admin user, will hash
|
41
|
+
# it using SHA1. If not, we'll assume the provided password is in plain text.
|
42
|
+
:hash_admin_password: <%= integrity_hash_admin_password %>
|
43
|
+
<%- end -%>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deprec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bailey
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-17 00:00:00 +11:00
|
13
13
|
default_executable: depify
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/deprec/recipes/git.rb
|
68
68
|
- lib/deprec/recipes/gitosis.rb
|
69
69
|
- lib/deprec/recipes/heartbeat.rb
|
70
|
+
- lib/deprec/recipes/integrity.rb
|
70
71
|
- lib/deprec/recipes/logrotate.rb
|
71
72
|
- lib/deprec/recipes/lvm.rb
|
72
73
|
- lib/deprec/recipes/memcache.rb
|
@@ -122,6 +123,10 @@ files:
|
|
122
123
|
- lib/deprec/templates/heartbeat/authkeys.erb
|
123
124
|
- lib/deprec/templates/heartbeat/ha.cf.erb
|
124
125
|
- lib/deprec/templates/heartbeat/haresources.erb
|
126
|
+
- lib/deprec/templates/integrity
|
127
|
+
- lib/deprec/templates/integrity/apache_vhost.erb
|
128
|
+
- lib/deprec/templates/integrity/config.ru.erb
|
129
|
+
- lib/deprec/templates/integrity/config.yml.erb
|
125
130
|
- lib/deprec/templates/logrotate
|
126
131
|
- lib/deprec/templates/logrotate/logrotate.conf.erb
|
127
132
|
- lib/deprec/templates/mongrel
|