docman 0.0.8 → 0.0.9
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/docman/deployers/deployer.rb +8 -0
- data/lib/docman/docroot_config.rb +2 -0
- data/lib/docman/git_util.rb +14 -2
- 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: d21d4701a1e78242691f9855ef44f869eb4b8a13
|
4
|
+
data.tar.gz: 4265af6c323295622bf23f8228444a752358fdb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 556e35cc141fb5e8d3599c1d5043b6e08655585261d981ed51bc9d139b63cc46570bcea2fdc2d14256b71b99e120402df9b8ddcc3490d441f3f6c59ccfba4c06
|
7
|
+
data.tar.gz: 87775b0e968e87c7a4fb6293e948638dd669053f866d62f209e71356efc2c25a439fec0dff333eeecafb0df2121c7fc64d4abf389bd42da0f4778a55f32b577f
|
@@ -42,6 +42,12 @@ module Docman
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
path = @docroot_config.root['full_build_path']
|
46
|
+
Dir.chdir path
|
47
|
+
if GitUtil.repo_changed? path
|
48
|
+
GitUtil.reset_repo path
|
49
|
+
end
|
50
|
+
|
45
51
|
stored_config_hash = read_version_file_param('config_hash')
|
46
52
|
@config_hash = Docman::Application.instance.config.config_hash
|
47
53
|
@config_yaml = Docman::Application.instance.config.to_yaml
|
@@ -95,6 +101,8 @@ module Docman
|
|
95
101
|
|
96
102
|
def read_file(path)
|
97
103
|
YAML::load_file(path)
|
104
|
+
rescue
|
105
|
+
raise "Error in config file #{path}"
|
98
106
|
end
|
99
107
|
|
100
108
|
def read_version_file_param(param)
|
@@ -78,6 +78,8 @@ module Docman
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def states_dependin_on(name, version)
|
81
|
+
raise "There is no project with name '#{name}' exists in config" unless @names.has_key? name
|
82
|
+
|
81
83
|
states = {}
|
82
84
|
@names[name]['states'].each do |state, info|
|
83
85
|
states[state] = info if info['version'] == version
|
data/lib/docman/git_util.rb
CHANGED
@@ -8,18 +8,30 @@ module Docman
|
|
8
8
|
|
9
9
|
def self.exec(command)
|
10
10
|
@logger.info command
|
11
|
-
|
11
|
+
result = `#{command}`.delete!("\n")
|
12
|
+
@logger.info result if result
|
13
|
+
raise result unless $?.exitstatus == 0
|
14
|
+
result
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.reset_repo(path)
|
18
|
+
Dir.chdir path
|
19
|
+
exec 'git reset --hard'
|
20
|
+
exec 'git clean -f -d'
|
12
21
|
end
|
13
22
|
|
14
23
|
def self.get(repo, path, type, version)
|
15
24
|
if File.directory? path and File.directory?(File.join(path, '.git'))
|
16
25
|
Dir.chdir path
|
26
|
+
|
27
|
+
self.reset_repo(path) if self.repo_changed?(path)
|
28
|
+
|
17
29
|
if type == 'branch'
|
18
30
|
exec "git checkout #{version}"
|
19
31
|
exec "git pull origin #{version}"
|
20
32
|
end
|
21
33
|
if type == 'tag'
|
22
|
-
exec
|
34
|
+
exec 'git fetch --tags'
|
23
35
|
exec "git checkout tags/#{version}"
|
24
36
|
end
|
25
37
|
else
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tolstikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|