beaker-module_install_helper 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +5 -5
- data/Rakefile +1 -1
- data/beaker-module_install_helper.gemspec +2 -1
- data/lib/beaker/module_install_helper.rb +2 -1
- data/spec/unit/beaker/module_install_helper_spec.rb +2 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a2c6ed3022d19e60e1d0384af079f91e88ca41
|
4
|
+
data.tar.gz: a735093e505f4b2bd462068f0bc51d1b2758f516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1776180ebfaa84699217d459e6edb6da441ab2521b53c6095767d944577f2e07432ea536cc83403e8bfa404b981e8a3112c80b7a58fe38bd8f9ff11a7f7dc7
|
7
|
+
data.tar.gz: 25239feb1592cdee1a638ca2fec9c463d6590c913e0ecdacd8c391942466e7b8bcaaff43569408ade407fb6af396ba761cbe46e1289705f86f6fadcd0460d0bd
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
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.1.5]
|
8
|
+
### Fixed
|
9
|
+
- Documentation language updates
|
10
|
+
- Rubocop fixes
|
11
|
+
- Failure to load Net::HTTP
|
12
|
+
|
13
|
+
|
14
|
+
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.5...HEAD
|
15
|
+
[0.1.5]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.4...0.1.5
|
16
|
+
[0.1.4]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.3...0.1.4
|
17
|
+
[0.1.3]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.2...0.1.3
|
18
|
+
[0.1.2]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.1...0.1.2
|
19
|
+
[0.1.1]: https://github.com/olivierlacan/keep-a-changelog/compare/0.1.0...0.1.1
|
data/README.md
CHANGED
@@ -35,15 +35,15 @@ This will call `install_module_dependencies_on` on the hosts with role 'master'.
|
|
35
35
|
### `install_module_dependencies_on`
|
36
36
|
This will install a list of dependencies on the specified host from the forge, using the dependencies list specified in the metadata.json file, taking into consideration the version constraints if specified.
|
37
37
|
|
38
|
-
**See
|
38
|
+
**See:** [Alternative Forge Instances](#alternative-forge-instances)
|
39
39
|
|
40
40
|
### `install_module_from_forge(module_name, version_requirement)`
|
41
|
-
This will call `install_module_from_forge_on` on the hosts with role 'master'. If there are none, the module will be
|
41
|
+
This will call `install_module_from_forge_on` on the hosts with role 'master'. If there are none, the module will be installed on all hosts with the role 'agent', again, if there are none, the module will be installed on all hosts.
|
42
42
|
|
43
43
|
### `install_module_from_forge_on(hosts, module_name, version_requirement)`
|
44
|
-
This will install a module from the forge on the given host(s). Module name must be specified in the {author}-{module_name} or {author}/{module_name} format. Version requirement must be specified to meet [this](https://docs.puppet.com/puppet/latest/modules_metadata.html#version-specifiers) criteria.
|
44
|
+
This will install a module from the forge on the given host(s). Module name must be specified in the `{author}-{module_name}` or `{author}/{module_name}` format. Version requirement must be specified to meet [this](https://docs.puppet.com/puppet/latest/modules_metadata.html#version-specifiers) criteria.
|
45
45
|
|
46
|
-
**See
|
46
|
+
**See:** [Alternative Forge Instances](#alternative-forge-instances)
|
47
47
|
|
48
48
|
### Alternative Forge Instances
|
49
49
|
It is possible to use alternative forge instances rather than the production forge instance to install module dependencies by specifiying 2 environment variables, `BEAKER_FORGE_HOST` and `BEAKER_FORGE_API`. Both of these are required as the forge API is used under the hood to resolve version requirement boundary strings.
|
@@ -54,4 +54,4 @@ BEAKER_FORGE_HOST=https://module-staging.puppetlabs.com BEAKER_FORGE_API=https:/
|
|
54
54
|
```
|
55
55
|
|
56
56
|
### Support
|
57
|
-
No support is supplied or implied. Use at your own risk.
|
57
|
+
No support is supplied or implied. Use at your own risk.
|
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
7
|
spec.name = 'beaker-module_install_helper'
|
7
|
-
spec.version = '0.1.
|
8
|
+
spec.version = '0.1.5'
|
8
9
|
spec.authors = ['Puppet']
|
9
10
|
spec.email = ['wilson@puppet.com']
|
10
11
|
|
@@ -69,7 +69,7 @@ module Beaker::ModuleInstallHelper
|
|
69
69
|
|
70
70
|
dependencies = []
|
71
71
|
metadata['dependencies'].each do |d|
|
72
|
-
tmp = { module_name: d['name'].sub
|
72
|
+
tmp = { module_name: d['name'].sub('/', '-') }
|
73
73
|
|
74
74
|
if d.key?('version_requirement')
|
75
75
|
tmp[:version] = module_version_from_requirement(tmp[:module_name],
|
@@ -86,6 +86,7 @@ module Beaker::ModuleInstallHelper
|
|
86
86
|
# and upper bounds. The function then uses the forge rest endpoint to find
|
87
87
|
# the most recent release of the given module matching the version requirement
|
88
88
|
def module_version_from_requirement(mod_name, vr_str)
|
89
|
+
require 'net/http'
|
89
90
|
uri = URI("#{forge_api}v3/modules/#{mod_name}")
|
90
91
|
response = Net::HTTP.get(uri)
|
91
92
|
forge_data = JSON.parse(response)
|
@@ -5,7 +5,7 @@ describe Beaker::ModuleInstallHelper do
|
|
5
5
|
context 'on split master/agent setup' do
|
6
6
|
let(:hosts) do
|
7
7
|
[
|
8
|
-
{ 'roles' => %w
|
8
|
+
{ 'roles' => %w[master database dashboard classifier] },
|
9
9
|
{ 'roles' => ['agent'] }
|
10
10
|
]
|
11
11
|
end
|
@@ -69,6 +69,7 @@ describe Beaker::ModuleInstallHelper do
|
|
69
69
|
|
70
70
|
context 'install_module_on' do
|
71
71
|
let(:module_source_dir) { '/a/b/c/d' }
|
72
|
+
let(:host) { { 'roles' => %w[master database dashboard classifier] } }
|
72
73
|
|
73
74
|
before do
|
74
75
|
$module_source_dir = '/a/b/c/d'
|
@@ -86,8 +87,6 @@ describe Beaker::ModuleInstallHelper do
|
|
86
87
|
.and_return(true)
|
87
88
|
end
|
88
89
|
|
89
|
-
let(:host) { { 'roles' => %w(master database dashboard classifier) } }
|
90
|
-
|
91
90
|
it 'copy module to given host' do
|
92
91
|
expect(install_module_on(host)).to be true
|
93
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-module_install_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- ".gitignore"
|
50
50
|
- ".rubocop.yml"
|
51
51
|
- ".travis.yml"
|
52
|
+
- CHANGELOG.md
|
52
53
|
- CONTRIBUTING.md
|
53
54
|
- Gemfile
|
54
55
|
- LICENSE
|
@@ -79,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
82
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.1
|
83
84
|
signing_key:
|
84
85
|
specification_version: 4
|
85
86
|
summary: A helper gem for use in a Puppet Modules spec_helper_acceptance.rb file
|