简化容器使用
项目描述
入门
Makim
(或 makim
) 基于 make
并专注于改进定义任务和依赖关系的方式。它使用 yaml
格式,而不是 Makefile
格式。
本项目的想法是提供一种带有一些控制选项(如条件 if
)定义任务和依赖关系的方法。
它允许以非常简单的方式定义文档中的文本和每个任务的额外参数。
- 许可: BSD 3条款
- 文档: https://osl-incubator.github.io/makim
功能
.makim.yaml
规范中,帮助文本作为一等公民。它可以由任务和参数使用。- 任务具有参数选项。
- 任务具有依赖关系选项。
- 依赖关系可以调用具有特定参数的任务。
- 依赖关系可以有条件控制流(
if
)。 - 允许创建组,因此可以根据主题组织任务。
- 任务和组可以选择用户定义变量和/或环境变量。
- 通过模板(使用 Jinja2)访问参数、变量或环境变量。
- 使用
env-file
键选择使用点环境文件。
如何使用它
首先,您需要将配置文件 .makim.yaml
放置在项目根目录下。这是一个配置文件的示例
version: 1.0.0
groups:
default:
env-file: .env
tasks:
clean:
help: Use this task to clean up temporary files
args:
all:
type: bool
action: store_true
help: Remove all files that are tracked by git
run: |
echo "remove file X"
build:
help: Build the program
args:
clean:
type: bool
action: store_true
help: if not set, the clean dependency will not be triggered.
dependencies:
- task: clean
if: {% raw %}${{ args.clean == true }}{% endraw %}
run: |
echo "build file x"
echo "build file y"
echo "build file z"
一些使用示例
-
运行
build
任务:makim build
-
运行
clean
任务:makim clean
-
运行带有
clean
标志的build
任务:makim build --clean
.makim.yaml
文件的帮助菜单如下所示
$ makim --help
usage: MakIm [--help] [--version] [--config-file MAKIM_FILE] [task]
MakIm is a tool that helps you to organize and simplify your helper commands.
positional arguments:
task
Specify the task command to be performed. Options are:
default:
--------
default.clean => Use this task to clean up temporary files
ARGS:
--all: (bool) Remove all files that are tracked by git
default.build => Build the program
ARGS:
--clean: (bool) if not set, the clean dependency will not be triggered.
options:
--help, -h
Show the help menu
--version
Show the version of the installed MakIm tool.
--config-file MAKIM_FILE
Specify a custom location for the config file.
If you have any problem, open an issue at: https://github.com/osl-incubator/makim
如您所见,帮助菜单会自动将 .makim.yaml
文件中定义的所有 help
键信息添加进来。
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分发
makim-1.16.0.tar.gz (13.5 kB 查看哈希值)
构建分发
makim-1.16.0-py3-none-any.whl (13.8 kB 查看哈希值)
关闭
makim-1.16.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4b6953fb709e9d8ba124c4adfd2e2c3c2f30213091e383125b375d50c6c660b4 |
|
MD5 | 011841050b1bb963b907fccb1f2e5dc4 |
|
BLAKE2b-256 | 0d75ddbbca84d981af26b4a12856e429f56954e55ea6eef2e4966c24f6bb394b |
关闭
makim-1.16.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3d41185faec0a6b1c919ff9cd368c2c6f02bcfa31139e8006bda603ac517d6be |
|
MD5 | b18d9987a89cb588411490dc50b8e744 |
|
BLAKE2b-256 | 35793d6a7c6450e0d1ed5bbb16be74bda3d54d55a9a88b481e0ad049b77a391b |