PHPackages                             yidas/deployer-php-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. yidas/deployer-php-cli

ActiveProject[DevOps &amp; Deployment](/categories/devops)

yidas/deployer-php-cli
======================

Code deployment tool based on RSYNC running by PHP-CLI script

1.13.0(5y ago)125869MITPHPPHP &gt;=5.4.0

Since Mar 1Pushed 3y ago3 watchersCompare

[ Source](https://github.com/yidas/deployer-php-cli)[ Packagist](https://packagist.org/packages/yidas/deployer-php-cli)[ Docs](https://github.com/yidas/deployer-php-cli)[ RSS](/packages/yidas-deployer-php-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (29)Used By (0)

Deployer PHP-CLI
================

[](#deployer-php-cli)

CI/CD Deployment tool written in PHP supported for popular frameworks

[![Latest Stable Version](https://camo.githubusercontent.com/67970f8b5390d6165461f9259bb121804ae0c3c0787a9e1368c799f409de5db6/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f6465706c6f7965722d7068702d636c692f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/deployer-php-cli)[![License](https://camo.githubusercontent.com/baf171ecbeaabe513505aacd0bb644bc80dc5e7c18bb8b5eec699ad0441be934/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f6465706c6f7965722d7068702d636c692f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/deployer-php-cli)

FEATURES
--------

[](#features)

- *Deploy to **multiple** servers by **projects/groups***
- ***Yii2, Laravel, Codeigniter3** Frameworks support*
- ***Pipeline support** for Git, Composer, test and customized tasks*
- ***CI/CD** automation solution*

Helping developers to deploy codes from local instance to remote instances.

---

OUTLINE
-------

[](#outline)

- [Demonstration](#demonstration)
- [Requirements](#requirements)
- [Installation](#installation)
    - [Composer Installation](#composer-installation)
    - [Wget Installation](#wget-installation)
        - [Make Command](#make-command)
    - [Startup](#startup)
    - [Upgrade](#upgrade)
- [Configuration](#configuration)
    - [Project Setting](#project-setting)
    - [Config Options](#config-options)
        - [Git](#git)
        - [Composer](#composer)
        - [Test](#test)
        - [Tests](#tests)
        - [Rsync](#rsync)
        - [Commands](#commands)
    - [Example](#example)
- [Usage](#usage)
    - [Interactive Project Select](#interactive-project-select)
    - [Non-Interactive Project Select](#non-interactive-project-select)
    - [Skip Flows](#skip-flows)
    - [Revert &amp; Reset back](#revert--reset-back)
- [Implementation](#implementation)
    - [Permissions Handling](#permissions-handling)
- [CI/CD](#cicd)
    - [Webhook](#webhook)
        - [PHP Web Setting](#php-web-setting)
        - [Gitlab](#gitlab)
- [Additions](#additions)
    - [Rsync without Password](#rsync-without-password)
    - [Save Binary Encode File](#save-binary-encode-file)
    - [Yii2 Deployment](#yii2-deployment)
    - [Minify/Uglify by Gulp](#minifyuglify-by-gulp)

---

DEMONSTRATION
-------------

[](#demonstration)

[![Basic Flow](https://camo.githubusercontent.com/67d0c168d89a7cd320b603862800cc69fb4d428a67eb2b82fc0c7332b4c15d57/68747470733a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f70726f78793f7372633d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f79696461732f6465706c6f7965722d7068702d636c692f6d61737465722f696d672f73657175656e63652d6469616772616d2e706c616e74756d6c)](https://camo.githubusercontent.com/67d0c168d89a7cd320b603862800cc69fb4d428a67eb2b82fc0c7332b4c15d57/68747470733a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f70726f78793f7372633d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f79696461732f6465706c6f7965722d7068702d636c692f6d61737465722f696d672f73657175656e63652d6469616772616d2e706c616e74756d6c)

### Command Line

[](#command-line)

Deploy local project to remote servers by just executing the deployer in command after installation:

```
$ deployer

```

> Alternatively, you could call the original bootstrap: `$ ./deployer`, `$ php ./deployer`

The interactive result could like be:

```
$ deployer

Your available projects in configuration:
  [0] your.project.com
  [1] second.project.com
  [2] other.site.com

  Please select a project [number or project, Ctrl+C to quit]:0

Selected Project: your.project.com
Successful Excuted Task: Git
Successful Excuted Task: Composer
Successful Excuted Task: Composer
Successful Excuted Task: Test UnitTest
Successful Excuted Task: Commands before: Minify assets
Successful Excuted Task: Deploy to 127.0.0.11
Successful Excuted Task: Deploy to 127.0.0.12
Successful Excuted Task: Deploy
Successful Excuted Task: Commands after: Email notification

```

Or you could run by non-interactive mode with the same purpose:

```
$ deployer --project="your.project.com"

```

---

REQUIREMENTS
------------

[](#requirements)

This library requires the following:

- PHP(CLI) 5.4.0+
- RSYNC

---

INSTALLATION
------------

[](#installation)

### Composer Installation

[](#composer-installation)

Using Composer by `sudoer` or `root` to install is the easiest way with auto-installer:

```
composer create-project --prefer-dist yidas/deployer-php-cli

```

### Wget Installation

[](#wget-installation)

You could see [Release](https://github.com/yidas/deployer-php-cli/releases) for picking up the package with version, for example:

```
$ wget https://github.com/yidas/deployer-php-cli/archive/master.tar.gz -O deployer-php-cli.tar.gz

```

After download, uncompress the package:

```
$ tar -zxvf deployer-php-cli.tar.gz

```

> In addition, you can rename the unzipped folder by `mkdir deployer-php-cli && tar -zxvf deployer-php-cli.tar.gz --strip-components 1 -C deployer-php-cli`

#### Make Command

[](#make-command)

To make a command for deployer, if the package folder is `deployer-php-cli` then create a symbol by following command:

```
$ sudo chmod +x $(pwd -L)/deployer-php-cli/deployer
$ sudo ln -s $(pwd -L)/deployer-php-cli/deployer /usr/bin/deployer

```

### Startup

[](#startup)

After installation, you could start to set up the `config.inc.php` for deployer, and enjoy to use:

```
$ deployer

```

### Upgrade

[](#upgrade)

To upgrade, you could re-install the deployer and copy the old `config.inc.php` to the new one, for example:

```
$ cp ./deployer-php-cli/config.inc.php ./
$ rm -r deployer-php-cli
$ composer create-project --prefer-dist yidas/deployer-php-cli
$ mv ./config.inc.php ./deployer-php-cli

```

---

CONFIGURATION
-------------

[](#configuration)

### Project Setting:

[](#project-setting)

You need to set up the projects configuration such as servers, source and destination in `config.inc.php` file:

```
