承接 mittwald/deployer-recipes 相关项目开发

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

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

mittwald/deployer-recipes

Composer 安装命令:

composer require mittwald/deployer-recipes

包简介

A collection of Deployer recipies for easily deploying your applications onto the mittwald platform

README 文档

README

⚒️ Installation instructions | 🙆 Usage | ⚙️ Configuration options | 📖 Documentation

Important

This library is currently in an beta state. We welcome any feedback and contributions.

This repository contains a set of mittwald-specific helper functions and recipes for Deployer.

Installation

Via Composer

In order to use this recipe collection, you need to install it via Composer:

composer require --dev mittwald/deployer-recipes

Using Docker

There is also a pre-built docker image, providing both deployer and the mittwald deployer recipes. You can use it like this:

docker run --rm -it -v $(pwd):/app -w /app mittwald/deployer:latest deploy

Usage

Note

Find configuration examples for common CI/CD tools like Github Actions and Gitlab CI at the bottom of this document.

This recipe needs a mittwald API token to work. It can be either provided via the MITTWALD_API_TOKEN environment variable, or by setting the mittwald_token value in your Deployer configuration.

$ export MITTWALD_API_TOKEN=...

In order to use the recipes provided by this library, you need to include them in your deploy.php file:

require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/mittwald/deployer-recipes/recipes/deploy.php';

To enable the automatic deployment for a host, set the mittwald_app_id variable to the ID of the mittwald application you want to deploy to (the ID may either be the full UUID of the application, or the short ID that is displayed in the UI or CLI). In this case, the hostname becomes irrelevant, as the recipe will automatically determine the correct hostname for the SSH connection:

host('mittwald')
    ->set('public_path', '/')
    ->set('mittwald_app_id', '<uuid|short-id>')
    ->set('mittwald_app_dependencies', [
        'php'      => '{{php_version}}',
        'gm'       => '*',
        'composer' => '*',
    ]);

Alternatively, you can also use the mittwald_app shorthand function for the same effect:

mittwald_app('<uuid|short-id>')
    ->set('public_path', '/')
    ->set('mittwald_app_dependencies', [
        'php'      => '{{php_version}}',
        'gm'       => '*',
        'composer' => '*',
    ]);

What does it do?

This recipe automates the provisioning of PHP applications on the mittwald cloud platform. You will only need to provide the recipe with the ID of the mittwald application you want to deploy to, and the recipe will take care of the rest by automatically determining the correct deployment path, database credentials, and so on.

More precisely, the recipe will:

  • Look up the deployment directory for the given application ID and set it as the deploy_path for deployer.
  • Correctly configure a virtual host for the domain configured in domain
  • Look up the necessary SSH connection data, create and manage an SSH user for the deployment, and configure the deployer host accordingly.
  • Make sure that the app's system environment matches the one configured in mittwald_app_dependencies

Configuration options

  • mittwald_app_id: The ID of the mittwald application you want to deploy to. This is the only required option, and should be set per host.

  • mittwald_app_dependencies: A map of system dependencies that should be installed on the mittwald application. The recipe will make sure that the app's system environment matches the one configured here.

    The expected format is a map, using system package names as keys and semver compatible version constraints as values.

    Defaults to ["php" => "{{php_version}}", "composer" => "*"].

  • mittwald_domains may be used to override the domains that should be configured. Defaults to ["{{domain}}"].

  • mittwald_domain_path_prefix can be used to configure a prefix for the domain path. Defaults to "/".

  • mittwald_ssh_public_key and mittwald_ssh_private_key may contain an SSH public/private key pair that should be used for deployment. If not set, the ssh_copy_id variable will be used.

Documentation & How-Tos

For more information on how to use this recipe, please refer to the documentation.

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-09