SimpleGitDeploy

Created: 2014-05-18 19:13
Updated: 2018-12-26 00:07
License: mit
php

README.md

SimpleGitDeploy


Personal project in development to discover Zend Framework 2 and PHPUnit. Tested on windows. Use it at your own risk.

Description

ZF2 module for deploying versioned files with git, from a local repository to a remote server through FTP or other directory through file manager. Works with Console.

How it works

  1. Current branch must be master and all the files commited
  2. Find modified files since the last deployed version.(The last deployed version is automatically tagged)
  3. On the remote path, the files are transfered or deleted, directories maked, depends on their status.

Installation

  1. Git clone the repository in vendor/
  2. Copy SimpleGitDeploy/Config/simplegitdeploy.local.php.dist to config/autolad/simplegitdeploy.local.php
  3. Add 'SimpleGitDeploy' to modules in config/application.config

Configuration file :

'simplegitdeploy' => array(
    /**
     * logger config
     */
    'logger' => array(
        'path'=>__dir__ . '/../../data/git_deploy/log',
        'stdr_output' => true,
    ),
    
    /**
     * git config
     */
    'git' => array(
        'bin' => 'git', //command to execute git
        'repository' => __dir__ . '/../..', //local git repository of the application
    ),
    
    /**
     * sender adapters for deployment
     * 'senders' => array( 
     *                  <alias1> => config array, 
     *                  <alias2> => config array, 
     *                  ... )
     */
    'senders' => array(
        'file' => array(
            'type' => '\SimpleGitDeploy\Service\Sender\FileManagerSender',
            'to_path' =>'', // '/path/to/deployment/directory',
            'deployment_tag' => 'git_deploy_file', //deployement tag for this adapter
        ),
        'ftp' => array(
            'type' => '\SimpleGitDeploy\Service\Sender\FtpSender',
            'to_path' =>'', // '/path/to/deployment/directory',
            'deployment_tag' => 'git_deploy_ftp', //deployement tag for this adapter
            'host' => '', //ftp host
            'user' => '', //ftp user
            'pass' => '', //ftp password
        )
    ),

Commands

index.php sgd config              Show config
index.php sgd branch              Show current branch
index.php sgd preview <sender>    Show files to be deployed for the specified <sender> defined in configuration
index.php sgd deploy <sender>     Deploy files with the <sender> defined in configuration
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more