Giter Site home page Giter Site logo

beezly / beaker-module_install_helper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voxpupuli/beaker-module_install_helper

0.0 2.0 0.0 38 KB

A library to make installing modules and their dependencies on test machines easier

License: Other

Ruby 100.00%

beaker-module_install_helper's Introduction

beaker-module_install_helper

This gem is simply an abstraction for the various functions that are performed within the spec/spec_helper_acceptance.rb files across the modules to standardise how these are implemented.

Usage

The below example will install the module from source on the host with role 'master', if that doesn't exist, on all hosts with role 'agent'. Otherwise it will be installed on all hosts.

require 'beaker/module_install_helper'
install_module_dependencies
install_module

# Install a testing only dependency, not specified in metadata
install_module_from_forge('puppetlabs-inifile', '>= 1.0.0 <= 50.0.0')

The below example will install the module from source on the specified host and install module dependencies specified in metadata.json on the host

require 'beaker/module_install_helper'
install_module_dependencies_on(host)
install_module_on(host)

Assumptions

  • Module under test has a valid metadata.json file at the root of the module directory.

install_module

This will call install_module_on on the hosts with role 'master'. If there are none, the module will be install on all hosts with the role 'agent', again, if there are none, the module will be installed on all hosts.

install_module_on(host)

This will install the module under test on the specified host using the local source. The module name will be derived from the name property of the module's metadata.json file, assuming it is in format author-modulename.

install_module_dependencies

This will call install_module_dependencies_on on the hosts with role 'master'. If there are none, the module will be install on all hosts with the role 'agent', again, if there are none, the module dependencies will be installed on all hosts.

install_module_dependencies_on

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.

See: Alternative Forge Instances

install_module_from_forge(module_name, version_requirement)

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.

install_module_from_forge_on(hosts, module_name, version_requirement)

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 criteria.

See: Alternative Forge Instances

Alternative Forge Instances

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.

Example Using Staging Forge

BEAKER_FORGE_HOST=https://module-staging.puppetlabs.com BEAKER_FORGE_API=https://api-module-staging.puppetlabs.com BEAKER_debug=true bundle exec rspec spec/acceptance

Support

No support is supplied or implied. Use at your own risk.

beaker-module_install_helper's People

Contributors

cdenneen avatar davids avatar ekohl avatar eputnam avatar hunner avatar pmcmaw avatar tphoney avatar wilson208 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.