承接 own3d/bunny-cli 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

own3d/bunny-cli

Composer 安装命令:

composer create-project own3d/bunny-cli

包简介

Replicate and store your files to the edge!

README 文档

README

Please use Bunny CLI for development purposes only. We have not yet released a stable release.

What is Bunny CLI?

Bunny CLI is a tool for the console to upload frontend frameworks such as Angular, Vue.js, React, or more recently, Blazor quickly to the Edge Store on Bunny CDN.

With Bunny CDN's Storage Edge, your web applications benefit from replicated storage zones, a global content delivery network that hosts files in 5 different regions worldwide and accelerates everything through a worldwide content delivery network with over 54+ PoPs.

How do I use Bunny CLI?

To install Bunny CLI, you need to be using Composer. For more details about Composer, see the Composer documentation.

composer global require own3d/bunny-cli

If you want to update the Bunny CLI, just execute the following command:

composer global update own3d/bunny-cli

After you install Bunny CLI, the next step is typically run the bunny init command to perform initial setup tasks. You can also run bunny init at a later time to change your settings or create a new configuration.

Run Bunny Init

To initialize Bunny CLI:

  1. Run bunny init:
bunny init
  1. Configure your API credentials.

In order for the Bunny CLI to work properly you need to store your Bunny CDN API token. You can find your API token in your Account Settings.

  1. Choose a current Storage Zone if prompted.

If you only have access to one storage zone, including the default pull zone, bunny init selects it for you.

When bunny init finishes, it saves the environment variables in your .env file.

You can view these environment variables at any other time using the bunny env:list command.

Deploy your first project

With the bunny deploy command, you can easily synchronize your dist folder with your edge storage.

IMPORTANT: All files in the edge storage that are not in your local dist directory will be deleted.

➜ $ bunny deploy  
- Hashing files...  
✔ Finished hashing 16360 files  
- CDN diffing files...  
✔ CDN requesting 10875 files  
- Synchronizing 10875 files  
 10875/10875 [============================] 100%  
✔ Finished synchronizing 10875 files  
- Waiting for deploy to go live...  
✔ Deployment is live! (322.96s)

Website URL: https://bunny-cli.b-cdn.net/

How do I integrate Bunny CLI into my GitHub Actions workflow?

We offer you a GitHub Action for Bunny CLI for free. You can easily upload your distributable files to your edge storage during your deployment process with this action. Just put your storage password (BUNNY_STORAGE_PASSWORD) and your API key (BUNNY_API_ACCESS_KEY) in the secrets of your GitHub repository and adjust your workflow as follows.

- name: Deploy to Edge Storage
  uses: own3d/bunny-action@main
  env:
    BUNNY_API_ACCESS_KEY: ${{ secrets.BUNNY_API_ACCESS_KEY }}
    BUNNY_STORAGE_USERNAME: bunny-cli
    BUNNY_STORAGE_PASSWORD: ${{ secrets.BUNNY_STORAGE_PASSWORD }}
    BUNNY_STORAGE_PATH: some_target_edge_dir (optional)
    BUNNY_PULL_ZONE_ID: 466588
  with:
    args: deploy --dir=dist

Environment Variables

You can customize your environment file at any time. The following commands are available for this purpose:

Command Description
env:list List all current environment variables.
env:set {key} {value} Set and save an environment variable in the .env file.
env:backup {file} Backup .env file into a given file.
env:restore {file} Restore .env file from a given file.

Secure your .well-known/bunny-cli.lock file

Bunny CLI generates a lock file, which is located at .well-known/bunny-cli.lock by default. This file locks the files of your project to a known state. To prevent this from being publicly accessible it is recommended to create a new edge rule in your pull zone. You can use the following example as a template:

Action: Block Request
Condition Matching: Match Any
Condition: If Request URL Match Any */.well-known/bunny-cli.lock

Now the file should no longer be accessible. It can take a few minutes until your Edge Rule is active.

Frequently Asked Questions

Q: Is this a zero-downtime deployment?

A: Depends. Only when the sync of the files is complete, the pull zone cache is cleared. Therefore if the CDN cache is not present because the cache has expired or miss, then an unanticipated event may occur.

We hope that together with Bunny CDN, we can solve this problem.

Q: Is this an official tool of Bunny CDN?

A: No. Bunny CLI is a community-driven tool and is not affiliated with Bunny CDN.

License

Bunny CLI is an open-source software licensed under the Apache 2.0 license.

own3d/bunny-cli 适用场景与选型建议

own3d/bunny-cli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.01k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2021 年 07 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cli」 「console」 「cdn」 「bunny」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 own3d/bunny-cli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 own3d/bunny-cli 我们能提供哪些服务?
定制开发 / 二次开发

基于 own3d/bunny-cli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-07-21