定制 sunnysideup/release 二次开发

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

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

sunnysideup/release

Composer 安装命令:

composer require sunnysideup/release

包简介

Auto-release latest version of a branch.

README 文档

README

This module helps you release your silverstripe (or other) projects.

install

composer require sunnysideup/release

release script usage

This module comes with an opiniated release script that can be used as follows:

try it

vendor/bin/sake-release -h

skip front-end flushing

The script flushes the cli and apache cache by default.

To skip flushing the front-end, set the following variable in your .env file:

SS_RELEASE_FRONT_END=false

to release a specific branch

In general, the script will release the branch

  1. set in your command - e.g. vendor/bin/sake-release develop will release the develop branch.
  2. if not set, the script will release the branch set in the .env file - e.g. SS_RELEASE_BRANCH=develop.
  3. if not set, the script will release the branch that fits your SS_ENVIRONMENT_TYPE - e.g. SS_ENVIRONMENT_TYPE=live will release the production branch. Mapping is as follows: live => production, staging => staging, test => test, dev => develop.

To release a specific branch, set the following variable in your .env file:

SS_RELEASE_BRANCH=feature/my-branch

speed up DEV/BUILD

To speed up the dev/build, you can add the following to your .env file:

SS_FAST_DEV_BUILD=true

other notes about releasing

Here are some general notes about releases. Use as you see fit.

requirements

release should be easy ....

  • Whenever you push to a designated branch, it releases on a server (test / production).
  • We are able to roll back (db + code)
  • Releases should be fast

option 1 - use bitbucket hook with this module

Here is how:

set up .env variables

set:

  • SS_RELEASE_TOKEN="FOO_BARFOO_BARFOO_BAR" # set to a random string
  • SS_RELEASE_SCRIPT="vendor/bin/sake-release"

in your .env file.

then add a hook to bitbucket:

https://mysite.co.nz/_resources/vendor/sunnysideup/release/client/ReleaseProjectFromBitbucketHook.php?ts=FOO_BARFOO_BARFOO_BAR

See https://confluence.atlassian.com/bitbucketserver/using-repository-hooks-776639836.html

option 2 - use BEAM

See https://github.com/heyday/beam/

option 3 - use bitbucket pipepline with this module

  1. enable pipelines: https://bitbucket.org/yourorganisation/yourproject/admin/addon/admin/pipelines/settings (see settings / pipelines / settings)

  2. create ssh key on bitbucket.com (settings > pipelines > ssh keys)

  3. add public ssh key to server in ~/.ssh/authorized_keys (or through a control panel)

  4. write file below as bitbucket-pipelines.yml in the root of your project

pipelines:
  branches:

    development:
      - step:
          script:
            - ssh -o StrictHostKeyChecking=no bitbucket@111.222.333.444 'cd ./var/www/mysite; bash vendor/bin/sake-release develop'

    master:
      - step:
          script:
            - ssh -o StrictHostKeyChecking=no bitbucket@111.222.333.444 'cd ./var/www/mysite; bash vendor/bin/sake-release production'
example pipelines with extra stuff

https://github.com/brettt89/silverstripe-docker

Option 4: use https://deployer.org/

TBC

Option 5: use github actions

TBC

sunnysideup/release 适用场景与选型建议

sunnysideup/release 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 1.83k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 sunnysideup/release 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: Shell

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-10-19