openminds_deploy 1.0.5.beta3 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +21 -0
  2. data/lib/openminds_deploy/configs.rb +29 -0
  3. metadata +6 -5
data/README.md CHANGED
@@ -103,3 +103,24 @@ avoid that:
103
103
  ### openminds_deploy/rails3
104
104
  * sets up bundling tasks with Bundler and does a basic check to see if the server you're on supports Rails 3.
105
105
  * only precompiles assets if there are changes detected in your assets or Gemfile
106
+
107
+ ### openminds_deploy/configs
108
+ * gives you some tasks to copy and symlink config files to the server
109
+
110
+ #### Example ####
111
+ To set up [Faye](http://faye.jcoglan.com/) you might have different configs for each environment (development, staging, production, ...). For doing so you might create the following config in `config/faye.yml`
112
+
113
+ development:
114
+ server_url: https://example.dev:9292/faye
115
+
116
+ staging:
117
+ server_url: https://staging.example.com:9292/faye
118
+
119
+ production:
120
+ server_url: https://example.com:9292/faye
121
+
122
+ Once you have that set up, you'll want to create the config during the first deploy and symlink the configs after each deploy. To set that up you'll have to set the `configs` variable in your `Capfile`:
123
+
124
+ set :configs, %w[faye]
125
+
126
+ Don't forget to require `openminds_deploy/configs` **after** setting the variable. That's it, now your configs will be copied and symlinked automatically.
@@ -0,0 +1,29 @@
1
+ configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist)
2
+
3
+ configuration.load do
4
+ unless exists?(:configs)
5
+ set :configs, [:database]
6
+ end
7
+
8
+ configs.each do |name|
9
+ namespace :configs do
10
+ namespace name do
11
+ desc "Create #{name}.yml in shared/config"
12
+ task :copy do
13
+ run "mkdir -p #{shared_path}/config"
14
+
15
+ CONFIG = YAML.load_file(%Q{./config/#{name}.yml})[stage.to_s]
16
+ put CONFIG.map{|key, value| "#{key}: #{value}\n"}.join, "#{shared_path}/config/#{name}.yml"
17
+ end
18
+
19
+ desc "Link the #{name}.yml"
20
+ task :link do
21
+ run "ln -nfs #{shared_path}/config/#{name}.yml #{release_path}/config/#{name}.yml"
22
+ end
23
+ end
24
+
25
+ after 'deploy:setup', "configs:#{name}:copy"
26
+ after 'deploy:finalize_update', "configs:#{name}:link"
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openminds_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5.beta3
5
- prerelease: 6
4
+ version: 1.0.5
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan De Poorter
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-04-19 00:00:00.000000000 Z
15
+ date: 2012-04-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: capistrano
@@ -37,6 +37,7 @@ extensions: []
37
37
  extra_rdoc_files:
38
38
  - README.md
39
39
  files:
40
+ - lib/openminds_deploy/configs.rb
40
41
  - lib/openminds_deploy/defaults.rb
41
42
  - lib/openminds_deploy/git.rb
42
43
  - lib/openminds_deploy/lighttpd.rb
@@ -61,9 +62,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
62
  required_rubygems_version: !ruby/object:Gem::Requirement
62
63
  none: false
63
64
  requirements:
64
- - - ! '>'
65
+ - - ! '>='
65
66
  - !ruby/object:Gem::Version
66
- version: 1.3.1
67
+ version: '0'
67
68
  requirements: []
68
69
  rubyforge_project:
69
70
  rubygems_version: 1.8.22