ecommit/deploy-rsync-bundle

使用 Rsync 部署 Symfony 项目

v2.0.0 2024-04-28 11:37 UTC

This package is auto-updated.

Last update: 2024-09-21 17:58:29 UTC


README

EcommitDeployRsyncBundle 包(适用于 Symfony)使用 RSYNC 部署您的 Symfony 项目。

Tests

安装

使用 Composer 安装包:在您的项目目录中,执行以下命令

$ composer require ecommit/deploy-rsync-bundle

在您的项目的 config/bundles.php 文件中启用该包

return [
    //...
    Ecommit\DeployRsyncBundle\EcommitDeployRsyncBundle::class => ['all' => true],
    //...
];

在您的项目中添加配置文件 config/packages/ecommit_deploy_rsync.yaml

ecommit_deploy_rsync:
    #Environments configuration
    environments:
        my_server1: #Environment name
            #Target - Required
            #The target can be either an SSH target or a local target
            #SSH target format: ssh://<username>@<hostname>:<path> or ssh://<username>@<hostname>:<port>:<path>
            #Local target format: file://<path>
            target: ssh://myuser@myserver.com:/home/remote_dir
            #rsync_options: [] #Rsync command options - Not required - Default values: [] - If not defined, the global rsync_options is used
            #ignore_file: #Rsync ignore file - Not required - Default value: null - If not defined, the global ignore_file option is used

        #You can define others environments :
        #my_server2:
            #target: ssh://myuser@myserver2.com:/home/remote_dir
    
    #Rsync global configuration
    #rsync:
        #rsync_path: rsync #Rsync bin path - Not required - Default value: "rsync"
        #rsync_options #Rsync command options (global) - Default values:
            # - '-azC'
            # - '--force'
            # - '--delete'
            # - '--progress'
        #ignore_file: #Rsync ignore file - Not required - Default value: null

用法

#Perform a trial run with no changes made
php bin/console ecommit:deploy-rsync my_server1
#Execute the changes
php bin/console ecommit:deploy-rsync my_server1 --go

许可证

此包可在 MIT 许可证下使用。请参阅 LICENSE 文件中的完整许可证。