定制 unleashedtech/deployer-recipes 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

unleashedtech/deployer-recipes

Composer 安装命令:

composer require unleashedtech/deployer-recipes

包简介

Deployer 7+ functionality used by Unleashed Technologies

README 文档

README

Latest Version Software License Build Status

This package uses Deployer 7, which supports recipes defined by YAML or PHP.

Deployer will import the recipes in a linear fashion. Placeholders will be replaced with actual values as late as possible. Deployer looks for deploy.php or deploy.yaml when run.

Installation

All recipe paths have been adjusted to use the files in the vendor directory and thus should be installed with composer:

composer require unleashedtech/deployer-recipes

Usage

Recipes have been organized to easily support any version of any software. They make several assumptions about git repository settings, deployment locations & host settings. These assumed default values are only applied if you haven't already defined them. Please choose a platform below for more.

Please note that tasks assume databases on relevant stages have already been configured. If you need to skip all database operations, you can set skip_db_ops to true via the command line.

Run vendor/bin/deployer.phar tree deploy to view the deploy recipe tree.

Run vendor/bin/deployer.phar deploy to deploy.

Run vendor/bin/deployer.phar to review available recipes.

Before/After Hooks

Deployer supports running tasks before or after other defined tasks. Defining custom tasks to trigger before & after other defined tasks is trivial. Such functionality can be added to the end of deploy.yaml, as shown below:

tasks:
    foo:
        script:
            - "echo 'foo'"
    bar:
        script:
            - "echo 'bar'"

after:
    deploy:symlink: foo

before:
    deploy:unlock: bar

SSH Hosts

This package will dynamically define hosts based on global configuration values. It loops over a CSV list of environments in the environments variable, defining 0 or more hosts for each environment. By default, production, staging & dev environments are defined. For each environment, the package defines a number of hosts based on the integer value of the matching {environment}_webservers variable (e.g. two hosts defined for production based on the production_webservers variable value). These hosts will be linked together by their environment name (or stage, in Deployer parlance). When you want to deploy to production, you would probably run a command similar to dep deploy stage=production. This package assumes there are 2 production webservers, by default.

config:
    ####
    production_domain: "production1.example"
    production_webservers: 3

Configuring SSH

The hosts defined by Deployer are merely aliases. During execution, Deployer will assume hosts defined internally are available via SSH. You can add hosts to your ~/.ssh/config file, or you can add Include directive(s) which will load config provided by other files into your main SSH config. Such definitions can occur immediately before an automated deployment.

Each project can provide its own SSH config. Consider creating an .ssh folder in your project root & creating a config file within.

You can manually include config for specific projects:

Include ~/projects/foo/.ssh/config

You can also use a pattern to auto-include project config from many folders:

Include ~/projects/*/.ssh/config

References

unleashedtech/deployer-recipes 适用场景与选型建议

unleashedtech/deployer-recipes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.96k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 unleashedtech/deployer-recipes 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 5.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 9
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-30