puppet2conf 0.1.0 → 0.2.0
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/CHANGELOG.md +16 -0
- data/lib/puppet2conf.rb +15 -4
- data/lib/puppet2conf/version.rb +1 -1
- data/puppet2conf.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb5e370daa0cab0da004c33572e4d3ddc308f23
|
4
|
+
data.tar.gz: 4728ea52f2767cdc3bf4f43225b72ef1dad77879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9cd9390fd0bd35ed10edf0166337b68ebae69f5d59fd843227386f96c60cbfd5b6445b52f0e1073696d7df9d6c3d4dc8b957799e61e00d0c21f822682fb4c5
|
7
|
+
data.tar.gz: 4bbf5705b9b3566c068c6bd54f5fdc911c97608137dc43bf6bce9a74043560399fe86272c129e4ed52ef951cc436ddf855abba08c49b403f20e8e72e91874e5e
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [0.2.0] - 2018-03-02
|
8
|
+
### Changed
|
9
|
+
- Updated behavior to work with recent release of `puppet-strings`.
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- Warn if attempt to create/update a page in Confluence fails.
|
13
|
+
|
14
|
+
## [0.1.0] - 2017-08-21
|
15
|
+
### Added
|
16
|
+
- Initial release.
|
data/lib/puppet2conf.rb
CHANGED
@@ -45,18 +45,24 @@ module Puppet2conf
|
|
45
45
|
end
|
46
46
|
if page.nil?
|
47
47
|
puts "Page '#{page_title}' doesn't exist, creating it"
|
48
|
-
@client.create(
|
48
|
+
response = @client.create(
|
49
49
|
type: 'page',
|
50
50
|
title: page_title,
|
51
51
|
space: { key: @config['space'] },
|
52
52
|
ancestors: ancestors,
|
53
53
|
body: { storage: { value: html, representation: 'storage' } }
|
54
54
|
)
|
55
|
+
if response['statusCode'].eql? 400
|
56
|
+
warn 'An error occurred while creating:'
|
57
|
+
warn response['message']
|
58
|
+
warn 'This can happen when a page exists with the same name, but different capitalization. Please fix it manually.'
|
59
|
+
exit 1
|
60
|
+
end
|
55
61
|
else
|
56
62
|
page = @client.get_by_id(page['id'])
|
57
63
|
puts "Page '#{page_title}' exists. Updating it"
|
58
|
-
version
|
59
|
-
@client.update(
|
64
|
+
version = page['version']['number'] || 1
|
65
|
+
response = @client.update(
|
60
66
|
page['id'],
|
61
67
|
type: 'page',
|
62
68
|
id: page['id'],
|
@@ -66,6 +72,11 @@ module Puppet2conf
|
|
66
72
|
version: { number: version + 1 },
|
67
73
|
body: { storage: { value: html, representation: 'storage' } }
|
68
74
|
)
|
75
|
+
if response['statusCode'].eql? 400
|
76
|
+
warn 'An error occurred while updating:'
|
77
|
+
warn response['message']
|
78
|
+
exit 1
|
79
|
+
end
|
69
80
|
end
|
70
81
|
end
|
71
82
|
|
@@ -83,7 +94,7 @@ module Puppet2conf
|
|
83
94
|
push_page(page_title, html, title_page)
|
84
95
|
end
|
85
96
|
if strings
|
86
|
-
PuppetStrings.generate(PuppetStrings::DEFAULT_SEARCH_PATTERNS, json: 'puppet_strings.json')
|
97
|
+
PuppetStrings.generate(PuppetStrings::DEFAULT_SEARCH_PATTERNS, json: true, path: 'puppet_strings.json')
|
87
98
|
reference_html = Strings2conf.convert(File.read('puppet_strings.json'))
|
88
99
|
push_page("#{title_page} Reference", reference_html, title_page)
|
89
100
|
end
|
data/lib/puppet2conf/version.rb
CHANGED
data/puppet2conf.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
spec.add_runtime_dependency 'md2conf'
|
19
19
|
spec.add_runtime_dependency 'strings2conf'
|
20
|
-
spec.add_runtime_dependency 'puppet-strings'
|
20
|
+
spec.add_runtime_dependency 'puppet-strings', '>= 1.2.1'
|
21
21
|
spec.add_runtime_dependency 'conf-api-client'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet2conf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Tyshkevich
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: md2conf
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 1.2.1
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 1.2.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: conf-api-client
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- ".gitignore"
|
121
121
|
- ".rspec"
|
122
122
|
- ".travis.yml"
|
123
|
+
- CHANGELOG.md
|
123
124
|
- CODE_OF_CONDUCT.md
|
124
125
|
- CONTRIBUTING.md
|
125
126
|
- Gemfile
|