docman 0.0.106 → 0.0.107
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docman/builders/git_provider_builder.rb +44 -4
- data/lib/docman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6b3416258a76e5e50ba333286140bbc1a033804e6b3814e0268ae1b5ecfa12
|
4
|
+
data.tar.gz: 9915e6a119f30316bc32114de05c5ef1ec179d83f39626f42ad2351cbe946f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840133302ae7401ce8530ba5ca530e7fcb8e290839b46631dcaf7575775041ae41027477f9c85d295b8ef2b3d35fce579abb482f55b677c208a33e04aed95e89
|
7
|
+
data.tar.gz: f2998e8c4b90cb901e9469c06f7e69c2ab8553f3633ff41eb95ca9f8cddb0fd7e1d85400cd6f3e30738998f0b59c37623b30366e0bb1afd44f208da9799fa0f2
|
@@ -9,10 +9,50 @@ module Docman
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def build_with_provider
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
docman_ignore_var = "DOCMAN_IGNORE"
|
13
|
+
if ENV.has_key? docman_ignore_var and ENV[docman_ignore_var].length > 0
|
14
|
+
puts "Variable #{docman_ignore_var} => #{ENV[docman_ignore_var]}. Use ignore workflow."
|
15
|
+
|
16
|
+
ignore = ['.git']
|
17
|
+
ignore_value = ENV[docman_ignore_var]
|
18
|
+
ignore_array = ignore_value.split(":")
|
19
|
+
ignore_array.each do |item|
|
20
|
+
ignore.push(item)
|
21
|
+
end
|
22
|
+
ignore.uniq!
|
23
|
+
|
24
|
+
find_ignore_array = []
|
25
|
+
ignore.each do |item|
|
26
|
+
find_ignore_array.push("^#{File.join(@context['full_build_path'], item).gsub('.', '\.')}/.*$")
|
27
|
+
path = ''
|
28
|
+
item.split("/").each do |part|
|
29
|
+
path = File.join(path, part)
|
30
|
+
find_ignore_array.push("^#{File.join(@context['full_build_path'], path).gsub('.', '\.')}$")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
find_ignore = "-e \"#{find_ignore_array.join("\" -e \"")}\""
|
34
|
+
|
35
|
+
puts "FIND IGNORE => #{find_ignore}"
|
36
|
+
`find #{@context['full_build_path']} -mindepth 1 -print0 | grep -z -v #{find_ignore} | xargs -0 -r -t rm -rf` if File.directory? @context['full_build_path']
|
37
|
+
FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
|
38
|
+
|
39
|
+
result = @provider.perform
|
40
|
+
|
41
|
+
rsync_ignore_array = ignore.each do |item|
|
42
|
+
"--exclude \"#{item}\""
|
43
|
+
end
|
44
|
+
rsync_ignore = "--exclude=\"/#{rsync_ignore_array.join("\" --exclude=\"/")}\""
|
45
|
+
|
46
|
+
puts "RSYNC IGNORE => #{rsync_ignore}"
|
47
|
+
`rsync -a #{rsync_ignore} #{self['target_path']}/. #{@context['full_build_path']}`
|
48
|
+
else
|
49
|
+
puts "Variable #{docman_ignore_var} not found. Use standard workflow."
|
50
|
+
`find #{@context['full_build_path']} -mindepth 1 -maxdepth 1 -not -name '.git' -exec rm -rf {} \\;` if File.directory? @context['full_build_path']
|
51
|
+
FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
|
52
|
+
result = @provider.perform
|
53
|
+
`rsync -a --exclude '.git' #{self['target_path']}/. #{@context['full_build_path']}`
|
54
|
+
end
|
55
|
+
|
16
56
|
result
|
17
57
|
end
|
18
58
|
|
data/lib/docman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.107
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tolstikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|