krisell/deployed-version-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

krisell/deployed-version-laravel

最新稳定版本:v1.1.0

Composer 安装命令:

composer require krisell/deployed-version-laravel

包简介

Adds a route to show currently running version

README 文档

README

This package helps with determining which version of your app is currently running. This is useful during a deploy, to see when it is finished, and also when you rollback to ensure that the correct version is loaded.

Installation

Add the package to your Laravel project.

composer require krisell/deployed-version-laravel

The package is configured for automatic discovery, so unless you have other settings, you do not need to manually add the service provider.

Usage

The package by default adds a route /version which displays the value of the environment-variable VERSION.

You need to set the value of this variable during your build or deploy process.

VERSION=YOUR_VERSION_VALUE

One way to achieve this is to run the following script, which uses the git hash as the version number, but you may do it however you like:

echo "VERSION=$(git -C gitdir rev-parse HEAD)" >> .env.current-build

.env.current-build refers to a copy of the .env-file, to ensure that the addition is not persistent.

The route can be customized by setting an optional prefix,

VERSION_ROUTE_PREFIX=custom-prefix

Which makes the route /custom-prefix/version.

The route returns simple JSON data,

{
  "version": "version-number"
}

Licence

MIT

Author

Martin Krisell (martin.krisell@gmail.com)

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-03