Git Product home page Git Product logo

rubygem-simp-module-repoclosure's Introduction

Build Status License

simp-module-repoclosure

A stupidly admirably direct dependency validator for a Puppet module's metadata.json. Use a tiny dedicated Puppet Forge to stage your modules' dependences with puppet module install!

Table of Contents

  1. Overview
  1. Setup
  1. Methods
  2. Environment variables
  3. Examples
  4. License

Overview

What this gem does

For each Module-under-test (or MUT):

  • Validate that the MUT will install from the Puppet Forge without breaking on dep-solving problems (such as version conflicts or missing dependencies).
  • Enable as much of this validation as possible within network-isolated enclaves.
  • TODO: Detect if dependencies are missing from metadata.json by using the contents of mods_dir/ as the fixture modules for spec_standalone tests.
  • TODO: Once missing dependencies are established, use the contents of mods_dir/ to identify missing modules in the .fixtures.yaml file.

How it does that

The MUT + dependencies are loaded into a local Puppet Forge and running puppet module install <MUT> against it. If the installation succeeds, the dependencies covered to publish on the live Puppet Forge.

Basic flow

![design](docs/img/simp-module-repoclosure design.png)

  1. (optional) An upstream Puppet Forge can be used to install the dependencies for the MUT into a mods_dir/ directory.
  • The forge server can be changed with the environment variable TEST_FORGE_deps_forge
  • With internet access and a single
  1. (optional, enclave-friendly) All modules in mods_dir/ are built into tar.gz archives to be served by the test Forge.
  • The mods_dir can be changed with the environment variable TEST_FORGE_mods_dir
  • If the mods_dir is defined, the upsteam dependency forge will not be contacted.
  1. (enclave-friendly) A temporary Puppet Forge is started on localhost and serves modules from tars_dir/. In a separate process, puppet module install is run for each MUT against the localhost Puppet Forge (modules are installed into a temporary directory). The test passes if all installs succeed.

Each step of the process can be modified or skipped using environment variables prefixed with TEST_FORGE_ (noted in maroon text on the diagram above).

Module dependency scenarios

![design](docs/img/simp-module-repoclosure tests.png)

Setup

Beginning with simp-module-repoclosure

Add this to your project's Gemfile:

gem 'simp-module-repoclosure'

Environment variables

You can set the environment variables TEST_FORGE_tars_dir and TEST_FORGE_mods_dir to use pre-existing diretories of modules for the local forge.

TEST_FORGE_deps_forge

The upstream Puppet Forge to download MUT dependencies from.

TEST_FORGE_mods_dir

(enclave-friendly) Customize the path of the mods_dir/ directory of unarchived module dependencies.

  • If TEST_FORGE_mods_dir is not set, mods_dir/ is a temporary directory.
  • If TEST_FORGE_mods_dir is customized, deps Puppet forge is no longer used

TEST_FORGE_tars_dir

(enclave-friendly) Customize the path of the tars_dir/ directory or archived .tar.gz modules. By the time the test Forge starts, tars_dir/ should include the MUT(s) and all dependencies.

  • If TEST_FORGE_tars_dir is not set, tars_dir/ is a temporary directory.
  • If TEST_FORGE_tars_dir is customized, the Puppet Forge and mod_path/ compilation steps will be skipped.

TEST_FORGE_port

The TCP port on localhost or the temporary test Forge to use.

  • If TEST_FORGE_port is no set the port will default to 8080.

Examples

TEST_FORGE_port=8888 bundle exec rake spec

License

See LICENSE

rubygem-simp-module-repoclosure's People

Contributors

op-ct avatar

Watchers

Nick Miller 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.