承接 adexyme/deploy-tagged-release 相关项目开发

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

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

adexyme/deploy-tagged-release

最新稳定版本:v1.0.2

Composer 安装命令:

composer require adexyme/deploy-tagged-release

包简介

Laravel CLI command to deploy a tagged release with custom schema (optional).

README 文档

README

Overview

DeployTaggedRelease is a Laravel Artisan command designed to:

  • Deploy a specific Git tag from a configured repository.
  • Install dependencies using Composer after pulling the code.
  • Optionally create missing tables and columns in the database (without affecting existing structure).
  • Use a GitHub personal access token for authenticated repo access.
  • Avoid Laravel’s migration system — ideal for rapid deployment or staging setups.

✅ Features

  • Deploy from any GitHub (or Git) repo using a Git tag.
  • Specify schema updates inline without needing migrations.
  • Auto-create tables if missing.
  • Auto-add columns if not present (but never alter or drop anything).
  • Use current DB connection if not overridden.
  • Full configuration via config/deploy.php.

📦 Installation

1. Require via Composer

bash

CopyEdit

composer require your-vendor/deploy-tagged-release

Replace your-vendor/deploy-tagged-release with your actual Packagist package name once published.

2. Register the Service Provider (if not auto-discovered)

In config/app.php:

php

CopyEdit

'providers' => [

// ...

YourVendor\DeployRelease\DeployTaggedReleaseServiceProvider::class,

],

3. Publish Configuration File

bash

CopyEdit

php artisan vendor:publish --tag=deploy-config

This creates a config file at:

arduino

CopyEdit

config/deploy.php

⚙️ Configuration

In config/deploy.php, define your deployment parameters:

php

CopyEdit

return [

// Remote Git repository URL

'repo' => env('DEPLOY_REPO', 'https://github.com/your-org/your-repo.git'),

// Local path to clone/pull the repo into

'path' => env('DEPLOY_PATH', base_path('deployed')),

// Optional: Name of database to use (leave null to use current DB)

'db' => env('DEPLOY_DB', null),

// Optional: GitHub personal access token for private repos

'token' => env('DEPLOY_GIT_TOKEN', null),

];

Place your GitHub token in .env as DEPLOY_GIT_TOKEN=ghp_xxxxxxxx.

🚀 Usage

Basic Command

bash

CopyEdit

php artisan deploy:tagged-release {tag} [--schema=...]

  • {tag}: Git tag to deploy (e.g., v1.0.2)
  • --schema: Optional semicolon-separated schema definition string.

Examples

✅ Deploy a Tag Only

bash

CopyEdit

php artisan deploy:tagged-release v1.0.0

  • Clones or pulls the repo
  • Checks out tag v1.0.0
  • Installs composer dependencies
  • Uses current DB
  • Skips schema creation

✅ Deploy with Table Creation

bash

CopyEdit

php artisan deploy:tagged-release v1.1.0 \

--schema="users:id:integer,name:string,email:string;posts:id:integer,title:string,body:text"

  • If users or posts tables do not exist, they are created.
  • If they exist, new columns are added (but existing columns remain untouched).
  • Fields use Laravel column types: string, integer, text, boolean, timestamp, etc.

✅ With Custom DB and Private Repo

In your .env:

env

CopyEdit

DEPLOY_REPO=https://github.com/your-org/your-private-repo.git

DEPLOY_DB=staging_db

DEPLOY_PATH=/var/www/releases

DEPLOY_GIT_TOKEN=ghp_yourTokenHere

Then run:

bash

CopyEdit

php artisan deploy:tagged-release v2.0.1 --schema="logs:id:integer,message:string"

🛠 Schema Syntax Details

Each --schema entry follows this format:

lua

CopyEdit

table:col:type,col:type;table2:col:type

Example:

bash

CopyEdit

php artisan deploy:tagged-release v3.0.0 \

--schema="products:id:integer,name:string,price:integer;orders:id:integer,product_id:integer,quantity:integer"

💡 Notes

  • This package does not use Laravel migrations.
  • It does not drop or modify existing columns.
  • It is ideal for quick deployments, CI/CD pipelines, and staging automation.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-13