foreman_templates 7.0.5 → 7.0.6
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
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 40c303f1207307e582859933360b3e2e9b2deb5793ff7816bf2fe2ccdd17b678
|
|
4
|
+
data.tar.gz: e25c5b35b84061c38f7051097e5c184a5369a1ba18974c40ae137e9828da3617
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78989629db36f53ca6aa96c396c3d32c02ed5176c3cf5026ccafb4ddc06aae85538ae8d68cdcd443bd9c8d8355c7bee507115606d7d9077d9c6d853052204286
|
|
7
|
+
data.tar.gz: 5ff10abf7e6c88946d008a17f6afe9fd8e5880b141d6b7ac9f833c2e789d40a42b03043aabc8024c02c473e18eb79fbaf0bde2dfd4d31c8adfee9d399dc7222c
|
|
@@ -14,6 +14,7 @@ module ForemanTemplates
|
|
|
14
14
|
:changed => changed?,
|
|
15
15
|
:imported => @imported,
|
|
16
16
|
:additional_errors => @additional_errors,
|
|
17
|
+
:additional_info => @additional_info,
|
|
17
18
|
:exception => @exception ? @exception.message : nil,
|
|
18
19
|
:validation_errors => errors.to_h,
|
|
19
20
|
:file => @template_file,
|
|
@@ -33,8 +33,13 @@ module ForemanTemplates
|
|
|
33
33
|
dump_files!
|
|
34
34
|
git_repo.add
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
new_repo = false
|
|
37
|
+
begin
|
|
38
|
+
status = git_repo.status
|
|
39
|
+
rescue Git::GitExecuteError # no HEAD for repo without commits, git diff-index HEAD fails
|
|
40
|
+
new_repo = true
|
|
41
|
+
end
|
|
42
|
+
if new_repo || status.added.any? || status.changed.any? || status.deleted.any? || status.untracked.any?
|
|
38
43
|
git_repo.commit "Templates export made by Foreman user #{foreman_git_user}"
|
|
39
44
|
git_repo.push 'origin', branch
|
|
40
45
|
@export_result.exported = true
|
|
@@ -50,13 +55,13 @@ module ForemanTemplates
|
|
|
50
55
|
|
|
51
56
|
def setup_git_branch(git_repo)
|
|
52
57
|
logger.debug "checking out branch '#{@branch}'"
|
|
53
|
-
if git_repo.is_branch?(@branch)
|
|
58
|
+
if git_repo.is_branch?(@branch) # local branch
|
|
54
59
|
git_repo.checkout(@branch)
|
|
55
|
-
|
|
60
|
+
elsif git_repo.is_remote_branch?(@branch) # if we work with remote branch, checkout and sync
|
|
56
61
|
git_repo.branch(@branch).checkout
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
git_repo.reset_hard("origin/#{@branch}")
|
|
63
|
+
else # neither local nor remote
|
|
64
|
+
git_repo.checkout(@branch, :new_branch => true)
|
|
60
65
|
end
|
|
61
66
|
end
|
|
62
67
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_templates
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.
|
|
4
|
+
version: 7.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Greg Sutcliffe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-01-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diffy
|
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
198
198
|
version: '0'
|
|
199
199
|
requirements: []
|
|
200
200
|
rubyforge_project:
|
|
201
|
-
rubygems_version: 2.6.
|
|
201
|
+
rubygems_version: 2.7.6.2
|
|
202
202
|
signing_key:
|
|
203
203
|
specification_version: 4
|
|
204
204
|
summary: Template-syncing engine for Foreman
|