docman 0.0.84 → 0.0.85
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 +4 -4
- data/lib/application.rb +1 -1
- data/lib/docman/cli.rb +4 -0
- data/lib/docman/deployers/deployer.rb +1 -1
- data/lib/docman/git_util.rb +17 -4
- data/lib/docman/logging.rb +7 -1
- data/lib/docman/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: 70c7c3f2b86000da6bcba2c94d22aeabe5f0d433
|
4
|
+
data.tar.gz: 0dc6785c2f831f4b75b3133c9050797ddd1bd9b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a890537942e8ea538ffd701615dad86fd9fbedc5f54cbfd28a7d75afa1da80a6e9f8b4aaa91f72340c8376d6f48216c93db076b56f82ba7fd5bb65909d9154
|
7
|
+
data.tar.gz: 4356556f737aaf1c98d0be54ec61c2beed20c2cded3c803a099b4468ca3a159c75f1528f2b359472a1b1edb96ee65b4301a3af435011cebca6b4c89b1d346dec
|
data/lib/application.rb
CHANGED
@@ -66,7 +66,7 @@ module Docman
|
|
66
66
|
def with_rescue(write_to_file = true)
|
67
67
|
failed_filepath = File.join(@workspace_dir, 'failed')
|
68
68
|
if File.file?(failed_filepath)
|
69
|
-
|
69
|
+
puts 'Last operation failed, forced rebuild mode'
|
70
70
|
FileUtils.rm_f failed_filepath
|
71
71
|
@force = true
|
72
72
|
end
|
data/lib/docman/cli.rb
CHANGED
@@ -10,6 +10,7 @@ module Docman
|
|
10
10
|
|
11
11
|
desc 'init "dirname" "repo"', 'Initialize docroot in "dirname" from config repo "repo"'
|
12
12
|
method_option :force, :aliases => '-f', :desc => 'Force init'
|
13
|
+
method_option :debug, :aliases => '-d', :desc => 'Debug'
|
13
14
|
method_option :skip, :aliases => '-s', :desc => 'Skip if docroot initialized already'
|
14
15
|
option :branch
|
15
16
|
def init(name, repo)
|
@@ -40,6 +41,7 @@ module Docman
|
|
40
41
|
|
41
42
|
desc 'build', 'Build docroot'
|
42
43
|
method_option :force, :aliases => '-f', :desc => 'Force full rebuild'
|
44
|
+
method_option :debug, :aliases => '-d', :desc => 'Debug'
|
43
45
|
method_option :config, :desc => 'Configuration override JSON'
|
44
46
|
method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
|
45
47
|
option :tag
|
@@ -54,6 +56,7 @@ module Docman
|
|
54
56
|
|
55
57
|
desc 'deploy', 'Deploy to target'
|
56
58
|
method_option :force, :aliases => '-f', :desc => 'Force full deploy'
|
59
|
+
method_option :debug, :aliases => '-d', :desc => 'Debug'
|
57
60
|
method_option :config, :desc => 'Configuration override JSON'
|
58
61
|
method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
|
59
62
|
def deploy(deploy_target, name, type, version)
|
@@ -99,6 +102,7 @@ module Docman
|
|
99
102
|
|
100
103
|
desc 'info', 'Get info'
|
101
104
|
method_option :force, :aliases => '-f', :desc => 'Force full rebuild'
|
105
|
+
method_option :debug, :aliases => '-d', :desc => 'Debug'
|
102
106
|
method_option :config_dir, :desc => 'Config directories divided by coma where docman will search for config.yaml'
|
103
107
|
option :tag
|
104
108
|
def info(command, file)
|
data/lib/docman/git_util.rb
CHANGED
@@ -19,14 +19,20 @@ module Docman
|
|
19
19
|
def self.squash_commits(commit_count, message = nil)
|
20
20
|
message = "$(git log --format=%B --reverse HEAD..HEAD@{1})" unless message
|
21
21
|
exec "reset --soft HEAD~#{commit_count}"
|
22
|
-
|
22
|
+
if Application::instance.options.has_key?('debug')
|
23
|
+
exec "commit --no-verify -m \"#{message}\""
|
24
|
+
else
|
25
|
+
exec "commit --quiet --no-verify -m \"#{message}\""
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def self.reset_repo(path)
|
26
30
|
Dir.chdir path
|
27
31
|
exec 'reset --hard'
|
28
|
-
|
29
|
-
|
32
|
+
if Application::instance.options.has_key?('debug')
|
33
|
+
exec 'clean -f -d -x --dry-run'
|
34
|
+
exec 'status'
|
35
|
+
end
|
30
36
|
exec 'clean -f -d -x'
|
31
37
|
end
|
32
38
|
|
@@ -86,7 +92,14 @@ module Docman
|
|
86
92
|
# pull root_path
|
87
93
|
Dir.chdir root_path
|
88
94
|
exec %Q(add --all #{path.slice "#{root_path}/"})
|
89
|
-
|
95
|
+
if repo_changed? path
|
96
|
+
if Application::instance.options.has_key?('debug')
|
97
|
+
exec %Q(commit --no-verify -m "#{message}")
|
98
|
+
else
|
99
|
+
exec %Q(commit --quiet --no-verify -m "#{message}")
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
90
103
|
self.tag(root_path, tag) if tag
|
91
104
|
Docman::Application.instance.commit_count = Docman::Application.instance.commit_count + 1
|
92
105
|
end
|
data/lib/docman/logging.rb
CHANGED
@@ -31,7 +31,13 @@ module Docman
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def log(message, type = 'debug')
|
34
|
-
|
34
|
+
if type == 'debug'
|
35
|
+
if Application::instance.options.has_key?('debug')
|
36
|
+
logger.send(type, "#{prefix} - #{message}")
|
37
|
+
end
|
38
|
+
else
|
39
|
+
logger.send(type, "#{prefix} - #{message}")
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
def prefix
|
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.85
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tolstikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|