Giter Site home page Giter Site logo

minilayer's Introduction

MiniLayer CLI

Installation

pip install minilayer[generate]

Feature Generation:

Usage: python -m minilayer generate devcontainer-feature [OPTIONS]
                                                        FEATURE_DEFINITION
                                                        OUTPUT_DIR

Arguments:
  FEATURE_DEFINITION  [required]
  OUTPUT_DIR          [required]

Options:
  --help                          Show this message and exit.

Input for feature generation is a feature-definition.json file This is an extended version of the devcontainer-feature.json file with additional fields:

{   
    ...
    regular devcontainer-json fields  like id, name, description etc
    ...


    # dependencies are list of features and options  (those will be installed as prerequisites to your feature)
    "dependencies": [
        {
            "feature": "ghcr.io/devcontainers-contrib/features/asdf-package:latest",
            "options": {
                "plugin": "act",

                "version": "latest"
            }
        }
    ],

    # This command will be executed after the dependency feature list has been installed
    "install_command": "echo 'Done'",

    # this example test scenario checks the default options (empty options dict), each test_command should exit wth code `0` if your feature is installed correctly.
    "test_scenarios": [
        {
            "name": "test_defaults",
            "image": "mcr.microsoft.com/devcontainers/base:debian",
            "test_commands": [
                "act --version"
            ],
            "options": {}
        }
    ]
}

redirect input

{
    ...


    "options": {
        "version": {
            "type": "string",
            "default": "latest",
            "description": "Select the version of act to install2."
        }
    },

    # you can also redirect one of your actual devcontainer-feature.json options values into a dependency input, note the `$options.version` pointer to the asdf-package version option
    "dependencies": [
        {
            "feature": "ghcr.io/devcontainers-contrib/features/asdf-package:latest",
            "options": {
                "plugin": "act",
                "version": "$options.version"
            }
        }
    ],

    ...
}

Usage example

this will generate the Elixir feature It assumes you have the minilayer cli already installed

git clone https://github.com/devcontainers-contrib/cli --depth 1
cd cli


minilayer generate devcontainer-feature "./test/resources/test_feature_definitions/elixir-asdf/feature-definition.json" "./output_dir"

minilayer's People

Contributors

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