public
Description: Vault
Homepage: http://peervoice.com/software/vault
Clone URL: git://github.com/ddollar/vault.git
Search Repo:
updated deployment scripts to allow target-based configuration files
ddollar (author)
Wed Apr 16 20:16:09 -0700 2008
commit  f1fa2f22898d22cc529d93713f58876289c0106f
tree    4537da48ef61418ec900811b7efabd6487a215e6
parent  86174b823929024d403842905e85faf9bc378b4a
...
8
9
10
 
 
...
8
9
10
11
12
0
@@ -8,4 +8,6 @@
0
 require 'rake/rdoctask'
0
 
0
 require 'tasks/rails'
0
+
0
+require 'lib/tasks/peervoice'
...
30
31
32
 
 
33
34
35
36
37
38
39
 
 
40
41
42
43
44
45
46
 
47
48
49
...
30
31
32
33
34
35
36
37
38
39
 
 
40
41
42
43
44
45
46
47
 
48
49
50
51
0
@@ -30,20 +30,22 @@
0
     desc "copy app-specific configuration files into place"
0
     task :application do
0
       run %{if [ -d #{conf_dir} ]; then cp -R #{conf_dir}/* #{current_path}/config/; fi}
0
+ require 'rake'
0
+ Rake::Task['peervoice:configure:target'].invoke
0
     end
0
     
0
     task :sqlite do
0
       run %{mkdir -p #{shared_path}/db}
0
       run %{ln -nfs #{shared_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3}
0
- end
0
-
0
+ end
0
+
0
   end
0
     
0
   namespace :mongrel do
0
 
0
     desc "get an available port for this mongrel"
0
     task :port do
0
- run %{/srv/util/mongrel_port/mongrel_port.rb "#{application}" "#{mongrel_conf}.dist" > "#{mongrel_conf}"}
0
+ run %{/srv/util/mongrel_port/mongrel_port.rb "#{application}" "#{mongrel_conf}.deploy" > "#{mongrel_conf}"}
0
     end
0
     
0
     desc "register this mongrel with nginx"
...
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
0
@@ -1 +1,8 @@
0
+---
0
+cwd: /srv/app/%%APPLICATION%%/current
0
+port: "%%PORT%%"
0
+environment: production
0
+address: 127.0.0.1
0
+pid_file: log/mongrel.pid
0
+servers: 1
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
@@ -1 +1,15 @@
0
+development:
0
+ adapter: sqlite3
0
+ database: db/development.sqlite3
0
+ timeout: 5000
0
+
0
+test:
0
+ adapter: sqlite3
0
+ database: db/test.sqlite3
0
+ timeout: 5000
0
+
0
+production:
0
+ adapter: sqlite3
0
+ database: db/production.sqlite3
0
+ timeout: 5000
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -1 +1,22 @@
0
+namespace :peervoice do
0
+
0
+ namespace :configure do
0
+
0
+ desc "configure this application as a given target TARGET (or default)"
0
+ task :target do
0
+ target = ENV["TARGET"] || 'default'
0
+
0
+ CONFIG_DIR = File.join(RAILS_ROOT, 'config')
0
+ TARGET_DIR = File.join(CONFIG_DIR, 'targets', target)
0
+
0
+ Dir[File.join(TARGET_DIR, '*')].each do |file|
0
+ filename = File.basename(file)
0
+ puts "Deploying: #{filename}"
0
+ cp File.join(TARGET_DIR, filename), File.join(CONFIG_DIR, filename)
0
+ end
0
+ end
0
+
0
+ end
0
+
0
+end

Comments

    No one has commented yet.