matron v1.0.12
Matron
A Domain Specific Language Ć -la Dockerfile with a CLI to scaffold your projects.
Installation
Using npx
If you don't prefer to install the CLI, you can use it through npx this way
npx matron --helpInstall with npm
You can also install the CLI globally
npm i -g matron
matron --helpQuick start
The minimal setup required to use matron and scaffold a new project is a matron.yml file.
Let's start with the example below:
š matron.yml
jobs:
create-folder:
name: Create project folder
steps:
- RUN: npx mkdirp ${PROJECT_PATH}
init-project:
name: Initialize package.json
steps:
- WORKDIR: ${PROJECT_PATH}
- RUN: npm init -y
add-typescript:
name: Add TypeScript
steps:
- RUN: yarn add -D typescriptā¶ļø matron command
matron create --matron-file=./matron.yml --project my-projectLet's break down each steps:
Create project folder
RUN: npx mkdirp ${PROJECT_PATH}: With theRUNcommand you can execute any command that is possible to execute on your shell.- Here we are using
mkdirpto create a folder at the pathmy-project. ${PROJECT_PATH}is a default environment variable provided when you specify the option--project.
Initialize package.json
WORKDIR: ${PROJECT_PATH}: With theWORKDIRcommand, all the subsequentRUNcommands will be executed in the specified path, in this case${PROJECT_PATH}equalsmy-project.RUN: npm init -y: This will create a minimalpackage.jsonfile.
- Add TypeScript
RUN: yarn add -D typescript: Add TypeScript as dev dependencies.
When executed, this will result in the following file tree:
my-project
āāā node_modules
āāā package.json
āāā yarn.lockš”You can learn more about the available commands here.
š”You can learn more about matron file schema here.
Commands
matron create
Create a project using a matron file
matron create [--matron-file] [--project] [--template] [--env-folder]Options
| Name | Alias | Description |
|---|---|---|
| --matron-file | -f | Matron file path. |
| --project | -p | Name or Path of the project to create. |
| --template | -t | Folder containing at least a matron.yml file. |
| --env-folder | .env files folder. | |
| --help | Show help |
Examples
# Creates a project at ./my-project using ./matron.yml file
matron create --matron-file=./matron.yml --project my-project
# Creates a project at path/to/ts-project using a template folder containing a matron.yml file and/or a .env file
matron create --template ./matron-templates/typescript --project path/to/ts-projectMatron File
Schema
Environments variables
Dynamic variables
Dotenv variables
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago