PHPackages                             nueip/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. nueip/deployer-php-cli

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

nueip/deployer-php-cli
======================

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

0.2.0(5y ago)071MITPHPPHP &gt;=5.4.0

Since Apr 18Pushed 5y agoCompare

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

READMEChangelog (2)DependenciesVersions (6)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/86ebc86695349079b57f5d1cd715e0a08a647a7db9934ca0d1b7e82d06a67acd/68747470733a2f2f706f7365722e707567782e6f72672f6e756569702f6465706c6f7965722d7068702d636c692f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/nueip/deployer-php-cli)[![License](https://camo.githubusercontent.com/8275da4ce63deaf1186525620154f0a69d4e2db14d646f8ae0c2252c555e2c16/68747470733a2f2f706f7365722e707567782e6f72672f6e756569702f6465706c6f7965722d7068702d636c692f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/nueip/deployer-php-cli)

FEATURES
--------

[](#features)

- *Deploy to **multiple** servers by **projects/groups***
- ***Yii2, Laravel, Codeigniter3** Frameworks support*
- ***Git, Composer support, tasks** for source project*
- ***CI/CD** solution*

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

---

OUTLINE
-------

[](#outline)

- [Deployer PHP-CLI](#deployer-php-cli)
    - [FEATURES](#features)
    - [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)
            - [1. Local and Remote Users](#1-local-and-remote-users)
            - [2. Application File Permissions](#2-application-file-permissions)
    - [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)
            - [1. Install NPM, for Debian/Ubuntu](#1-install-npm-for-debianubuntu)
            - [2. Install Gulp by NPM](#2-install-gulp-by-npm)
            - [3. Create Gulp Project](#3-create-gulp-project)
            - [4. Set Gulp with packages](#4-set-gulp-with-packages)
            - [5. Set Gulp Process into Deployer](#5-set-gulp-process-into-deployer)

---

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

[](#demonstration)

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

```
user@stage:~$ deployer
```

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

The interactive result could like be:

```
user@stage:~$ 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: Deploy to 127.0.0.11
Successful Excuted Task: Deploy to 127.0.0.12
Successful Excuted Task: Deploy
```

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

```
user@stage:~$ 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:

```
user@stage:/srv$ composer create-project --prefer-dist nueip/deployer-php-cli
```

### Wget Installation

[](#wget-installation)

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

```
user@stage:~$ wget https://github.com/nueip/deployer-php-cli/archive/master.tar.gz -O deployer-php-cli.tar.gz
```

After download, uncompress the package:

```
user@stage:~$ 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:

```
user@stage:~$ sudo chmod +x $(pwd -L)/deployer-php-cli/deployer
user@stage:~$ 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:

```
user@stage:~$ deployer
```

### Upgrade

[](#upgrade)

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

```
user@stage:/srv/deployer$ cp ./deployer-php-cli/config.inc.php ./
user@stage:/srv/deployer$ rm -r deployer-php-cli
user@stage:/srv/deployer$ composer create-project --prefer-dist nueip/deployer-php-cli
user@stage:/srv/deployer$ 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:

```
