承接 nexabyte/deployer 相关项目开发

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

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

nexabyte/deployer

Composer 安装命令:

composer require nexabyte/deployer

包简介

Handling deployed data on a server.

README 文档

README

PHP script for handling deployed data on a server.

No data will be transferred to the server. This script is used with a CI/CD server, after the files have been built and transferred to the upload directory.

There will be a folder releases with the last releases and a symlink current with the currently active release created.

The PHP opcache has some problems with symlinks, so that the deprecated releases are moved to an archive folder.

If database credentials are given, the database will be dumped into a zip-file inside of the db_backup folder.

How to

Use it in a file (i.e. deploy.php) like this:

#!/usr/bin/env php
use Nexabyte\Deployer\Deployer;

include 'Deployer.php';

$deployer = new Deployer();

$deployer->writeln("<info>Deployment started</info>");
$deployer->setSharedDirs([
    'var',
    'storage',
]);
$deployer->setSharedFiles([
    '.env.local',
]);

// Make a DB backup (can be omitted)
$deployer->setDbUser('user');
$deployer->setDbPass('password');
$deployer->setDbTable('tablename');

// Deploy it
$deployer->deploy();

Then run it with:

./deploy.php
#or
php deploy.php

Options

// Change number of kept releases:
$deployer->setKeepReleases(5);

// Switch off zip compression for database backups:
$deployer->setDbBackupCompress(false);

// Write to the terminal:
$deployer->writeln("<info>Deployment started</info>");

// Change the deploy path
$deployer->setDeployPath('sub/folder');

// Add hooks
$deployer->addHook(Deployer::HOOK_HANDLE_SHARED_BEFORE, 'echo {{current_release_dir}} && cd {{current_release_dir}} 2>&1 && ls -la');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固