hgraca/bake
Composer 安装命令:
composer require hgraca/bake
包简介
Make-like functionality, built in Bash.
README 文档
README
Bake is a Make like build system, built in bash.
The intent is to make it easier and more flexible than Make.
How to use
Install
Install with composer require hgraca\bake.
You will need to accept a few plugins so that bash scripts can be managed using composer.
You can install bake autocomplete and global link by running sudo ./vendor/bin/bake install
Global installation
Alternatively, you can also install it globally (tested on Ubuntu based distributions).
Install with composer global require hgraca\bake.
You will need to accept a few plugins so that bash scripts can be managed using composer.
You can install bake autocomplete and global link by running sudo ~/.composer/vendor/bin/bake install
Set up bake home
The bake home, bust be .bake, on the root of your project.
You can place a bootstrap file, bootstrap.sh, in the root of bakes' home.
The recipes must live under .bake/recipes/....
Optionally, you can create folders that will be included according to the environment variable ENV,
which you can set in the bootstrap.sh.
In bootstrap.sh you can also set the logging level. You can find all the logging levels here.
Example bootstrap.sh:
#!/usr/bin/env bash
ENV='dev'
export BASH_OVERLAY_LOG_LEVEL=${BASH_OVERLAY_LOG_LEVEL_INFO}
Example .bake structure:
.
├── .bake/
│ ├── bootstrap.sh
│ ├── recipes/
│ │ ├── global-recipes-file-01.sh
│ │ ├── dev/
│ │ │ ├── recipes-file-01.sh
│ │ │ ├── recipes-file-02.sh
│ │ │ └── ...
│ │ └── test/
│ │ ├── recipes-file-03.sh
│ │ ├── recipes-file-04.sh
│ │ └── ...
│ └── whatever-else/
│ └── ...
├── bin
├── src
├── tests
└── ...
Creating and using recipes
In a recipe file you create a function prefixed bake.recipe.<my_recipe>, which you then call like bake <my_recipe>.
For example, take the following recipe file:
#!/usr/bin/env bash
########################################################################################################################
# NAMING CONVENTIONS
#
# Please keep the functions ordered alphabetically
#
# Functions names must start with `bake.` so that on the main script we can find the functions available to our "bake".
# Use `.` as a namespace separator (When we double click, it selects only until the `.`)
# Use `-` as a sub separator (When we double click, it selects only until the `-`)
# Use `_` as a word separator (When we double click, it selects including and over the `_`)
#
# Use `.` as the first character in a function name to hide it
#
# At the end of the file place the aliases for backwards compatibility
#
########################################################################################################################
bake.recipe.my_new_command() {
echo ""
echo "==============================================="
echo "===== Hello word, in ${FUNCNAME[0]}, with arguments $* ..."
echo "==============================================="
}
########################################################################################################################
# Aliases for backwards compatibility
###
bake.recipe.my_old_command() {
bake.my_new_command "$@"
}
hgraca/bake 适用场景与选型建议
hgraca/bake 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hgraca/bake 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hgraca/bake 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-02