2 个版本
| 0.3.2 | 2022年8月8日 | 
|---|---|
| 0.3.1 | 2022年7月15日 | 
#14 in #复用
11KB
141 行
多运行
一次运行多个命令并复用输出的 CLI 工具
安装
首先通过 https://rustup.rs 安装 Rust 编译器,然后运行 cargo install multirun
用法
创建一个 multirun.json 文件,然后运行 multirun。
示例 multirun.json
{
    "paths": {
        "DEV_ENV_FILE": "./admin/.dev.env",
    },
    "services": {
        "accounts": {
            "directory": "./accounts",
            "command": "npm run start",
            "environment": {
              "ENV_FILE": "${paths.DEV_ENV_FILE}",
              "FORCE_COLOR": "1"
            }
        },
        "compliance": {
            "directory": "./compliance",
            "command": "npm run start",
            "environment": {
              "ENV_FILE": "${paths.DEV_ENV_FILE}",
              "FORCE_COLOR": "1"
            }
        },
        "hasura": {
            "directory": ".",
            "command": "graphql-engine serve",
            "environment": {
                "HASURA_GRAPHQL_DATABASE_URL": "postgres://cw:cw@localhost/cw",
                "HASURA_GRAPHQL_AUTH_HOOK": "https://:3401/hasura/auth-webhook",
                "HASURA_GRAPHQL_SERVER_PORT": "3399",
                "HASURA_GRAPHQL_ADMIN_SECRET": "amazing",
                "HASURA_GRAPHQL_ENABLE_CONSOLE": "true",
                "HASURA_GRAPHQL_V1_BOOLEAN_NULL_COLLAPSE": "true"
            }
        }
    }
}
在 paths 部分和服务的 directory 字段中的变量值作为相对于 multirun.json 文件位置的路径解析。
依赖项
~6–15MB
~163K SLoC