capistrano-template 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d22bbf4b677ef6f6caf5a392ef945d42d7c9f10d
|
4
|
+
data.tar.gz: d1593087344132c09a1272469c3dcb085a7194f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5ef31f7beb2748c98a3d8f29931a11599d8ca0f7658e7092024ae74bc2b68c711dcd6f0174b0d08ec7bdc97a76484c8bcb2eb609c64eaa2c0a9eb5810383ea2
|
7
|
+
data.tar.gz: ab00f8c7da4d40f4ab97a35f72759ce8e60c220d24943d34c0b15eb07ce74f0c971f488521f8319f6f3003207ad63469712e4c8860d95513d195d2aa1b7fb867
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
[](http://badge.fury.io/rb/capistrano-template)
|
2
2
|
[](https://travis-ci.org/faber-lotto/capistrano-template)
|
3
3
|
[](https://codeclimate.com/github/faber-lotto/capistrano-template)
|
4
|
+
[](https://coveralls.io/r/faber-lotto/capistrano-template?branch=master)
|
4
5
|
|
5
6
|
# Capistrano::Template
|
6
7
|
|
@@ -116,7 +117,7 @@ This settings can be changed in your Capfile, deploy.rb or stage file.
|
|
116
117
|
| Variable | Default | Description |
|
117
118
|
|-----------------------|---------------------------------------|---------------------------------------|
|
118
119
|
|`templating_digster` | <code> ->(data){ Digest::MD5.hexdigest(data)} </code> | Checksum algorythmous for rendered template to check for remote diffs |
|
119
|
-
|`templating_digest_cmd`| <code>%Q{test "Z$(openssl md5 %<path>s | sed
|
120
|
+
|`templating_digest_cmd`| <code>%Q{test "Z$(openssl md5 %<path>s | sed 's/^.*= *//')" = "Z%<digest>s" }</code> | Remote command to validate a digest. Format placeholders path is replaces by full `path` to the remote file and `digest` with the digest calculated in capistrano. |
|
120
121
|
|`templating_mode_test_cmd` | <code>%Q{ [ "Z$(printf "%%.4o" 0$(stat -c "%%a" %<path>s 2>/dev/null || stat -f "%%A" %<path>s))" != "Z%<mode>s" ] }</code> | Test command to check the remote file permissions. |
|
121
122
|
| `templating_paths` | <code>["config/deploy/templates/#{fetch(:stage)}/%<host>s",</code> <br> <code> "config/deploy/templates/#{fetch(:stage)}",</code> <br> <code> "config/deploy/templates/shared/%<host>s",</code> <br> <code> "config/deploy/templates/shared"]</code>| Folder to look for a template to render. `<host>` is replaced by the actual host. |
|
122
123
|
|
@@ -1,5 +1,9 @@
|
|
1
1
|
require 'capistrano/template'
|
2
|
+
require 'sshkit/all'
|
2
3
|
|
3
|
-
|
4
|
+
# don't pollute global namespace
|
5
|
+
extend Capistrano::Template::Helpers::DSL
|
6
|
+
|
7
|
+
SSHKit::Backend::Netssh.send(:include, Capistrano::Template::Helpers::DSL)
|
4
8
|
|
5
9
|
import File.join(__dir__, 'template', 'tasks', 'template_defaults.rake')
|
@@ -47,7 +47,7 @@ module Capistrano
|
|
47
47
|
path = File.dirname(path)
|
48
48
|
end
|
49
49
|
|
50
|
-
remote_path = capture("(cd #{path} && pwd -P) || readlink -sf #{path}").chomp
|
50
|
+
remote_path = capture("/bin/bash -c '(cd #{path} && pwd -P) || readlink -sf #{path}'").chomp
|
51
51
|
|
52
52
|
includes_filename ? File.join(remote_path, filename) : remote_path
|
53
53
|
end
|
@@ -55,6 +55,14 @@ module Capistrano
|
|
55
55
|
def _template_factory
|
56
56
|
->(from, context, digester) {TemplateDigester.new(Renderer.new(from, context), digester) }
|
57
57
|
end
|
58
|
+
|
59
|
+
def method_missing(method_name, *args)
|
60
|
+
if self.class.respond_to? method_name
|
61
|
+
self.class.send(method_name, *args)
|
62
|
+
else
|
63
|
+
super
|
64
|
+
end
|
65
|
+
end
|
58
66
|
end
|
59
67
|
end
|
60
68
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
3
|
set :templating_digster, ->{ ->(data){ Digest::MD5.hexdigest(data)} }
|
4
|
-
set :templating_digest_cmd, %Q{test "Z$(openssl md5 %<path>s| sed
|
4
|
+
set :templating_digest_cmd, %Q{test "Z$(openssl md5 %<path>s| sed 's/^.*= *//')" = "Z%<digest>s" } # alternative %Q{echo "%<digest>s %<path>s" | md5sum -c --status } should return true when the file content is the same
|
5
5
|
set :templating_mode_test_cmd, %Q{ [ "Z$(printf "%%.4o" 0$(stat -c "%%a" %<path>s 2>/dev/null || stat -f "%%A" %<path>s))" != "Z%<mode>s" ] } # mac uses different mode formatter
|
6
6
|
set :templating_paths , ->{ ["config/deploy/templates/#{fetch(:stage)}/%<host>s",
|
7
7
|
"config/deploy/templates/#{fetch(:stage)}",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dieter Späth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|