overlay 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +22 -22
- data/lib/overlay/github.rb +11 -2
- data/lib/overlay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2bc51314c212122ad2b8a7f1f1af525045c8093
|
4
|
+
data.tar.gz: 806a0956d020d9bd06228358cfa1aea205d8d91a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6adeb5747620b6fb44bcbaf1274e37249bcfb7ea479a0647e2a842e458a336b6f3111062b157399769627e4f49ee45a26e7ada9bd671c97ed37392a14b005ed8
|
7
|
+
data.tar.gz: 426de9370d852845485014a2d963f764c93a9e47fa22de7d87260500b4cd7d675933a7a288cfdfd1ad7a7786af5a479efe81f7258d22d80cf0eb8a8b79787b10
|
data/README.rdoc
CHANGED
@@ -1,29 +1,24 @@
|
|
1
1
|
Overlay
|
2
|
-
|
3
|
-
|
4
|
-
Rails engine that allows for overlaying external templates onto an existing Rails application. Overlayed directories are prepended to the view path to allow overwriting of deployed templates.
|
2
|
+
---------------------
|
3
|
+
Rails engine that allows for overlaying external files onto an existing Rails application. Overlayed directories are prepended to the view path to allow overwriting of deployed templates. A post overlay hook is provided to allow for cache invalidation and processing to run after a file is updated.
|
5
4
|
|
6
5
|
Features
|
7
|
-
====================
|
8
|
-
|
9
|
-
GithubRepo Features
|
10
6
|
---------------------
|
11
|
-
|
7
|
+
GithubRepo Features
|
8
|
+
====================
|
12
9
|
* Overlay separate directories in a single repo to specific places in your Rails application.
|
13
10
|
* Update files in realtime utilizing self registering post commit webhooks on github.
|
14
11
|
* Run code on file update via the GithubRepo #after_process_hook block.
|
15
12
|
* Utilize an OverlayPublisher application and a redis server to centralize hook management and publish changes to a fleet of servers.
|
16
13
|
|
17
14
|
Installation
|
18
|
-
|
19
|
-
|
15
|
+
---------------------
|
20
16
|
Add the gem to your Gemfile:
|
21
17
|
|
22
18
|
gem 'overlay'
|
23
19
|
|
24
20
|
Configuration
|
25
|
-
|
26
|
-
|
21
|
+
---------------------
|
27
22
|
Add an initializer to your Rails `config/initializers` directory. This file should configure your repositories and launch the initial overlay. Here is a sample initializer:
|
28
23
|
|
29
24
|
require 'overlay'
|
@@ -31,14 +26,13 @@ Add an initializer to your Rails `config/initializers` directory. This file sho
|
|
31
26
|
Overlay.configure do |config|
|
32
27
|
config.relative_root_url = Rails.application.config.relative_url_root
|
33
28
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
config.repositories << repo_config
|
29
|
+
config.repositories << Overlay::GithubRepo.new({
|
30
|
+
org: '<repo organization name>',
|
31
|
+
repo: '<repo name>',
|
32
|
+
auth: '<repo user>:<user password>',
|
33
|
+
root_source_path: '<repository source directory>',
|
34
|
+
root_dest_path: '<overlay destination directory>'
|
35
|
+
})
|
42
36
|
end
|
43
37
|
|
44
38
|
# Overlay files after rails is initialized
|
@@ -47,10 +41,16 @@ Add an initializer to your Rails `config/initializers` directory. This file sho
|
|
47
41
|
Overlay::Github.instance.process_overlays
|
48
42
|
end
|
49
43
|
|
50
|
-
|
51
|
-
|
44
|
+
Overlay also supports an external OverLay publisher installation for use with larger fleets. Per repo, this functionality can be anabled by adding the following config to your repository configuration:
|
45
|
+
|
46
|
+
repo_config.use_publisher = true
|
47
|
+
repo_config.redis_server = '<redis server>'
|
48
|
+
repo_config.redis_port = <redis server port>
|
49
|
+
repo_config.registration_server = 'http://<OverlayPublisher server and port>'
|
52
50
|
|
53
|
-
|
51
|
+
Usage
|
52
|
+
---------------------
|
53
|
+
Once Overlay is configured, a call to Overlay::Github.instance.process_overlays wil fork a process to run the initial pull-down of files from the repository. Overlay will update specific files on change in the repo through use of Github webhooks.
|
54
54
|
|
55
55
|
If you are using unicorn, you need to be sure to provide host_name and host_port if using self-subscription for Github webhooks.
|
56
56
|
|
data/lib/overlay/github.rb
CHANGED
@@ -19,6 +19,7 @@ module Overlay
|
|
19
19
|
|
20
20
|
def initialize
|
21
21
|
@subscribed_configs = []
|
22
|
+
@master_pid = $$
|
22
23
|
end
|
23
24
|
|
24
25
|
# Cycle through all configured repositories and overlay
|
@@ -256,12 +257,20 @@ module Overlay
|
|
256
257
|
end
|
257
258
|
|
258
259
|
# Process the passed in function symbol and args in a fork
|
260
|
+
# Add at exit hook to insure we kill our process. Insure we only do this
|
261
|
+
# from the master process
|
259
262
|
def fork_it method, *args
|
260
263
|
pid = Process.fork do
|
261
|
-
|
262
|
-
|
264
|
+
begin
|
265
|
+
send(method, *args)
|
266
|
+
ensure
|
267
|
+
Process.exit
|
268
|
+
end
|
263
269
|
end
|
264
270
|
Process.detach(pid)
|
271
|
+
at_exit do
|
272
|
+
Process.kill(:QUIT, pid) if @master_pid == $$
|
273
|
+
end
|
265
274
|
end
|
266
275
|
end
|
267
276
|
end
|
data/lib/overlay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overlay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Saarinen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|