CodeIgniter Forums
CodeIgniter Git Deploy For Github - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CodeIgniter Git Deploy For Github (/showthread.php?tid=54134)



CodeIgniter Git Deploy For Github - El Forum - 08-23-2012

[eluser]appleboy[/eluser]
Source Project : https://github.com/appleboy/PHP-Git-Deploy

CodeIgniter-Git-Deploy

Using Post-Receive Hooks to deploy muliple projects with CodeIgniter automatically.

Ref: https://help.github.com/articles/post-receive-hooks

Installation/Usage

Download files from https://github.com/appleboy/PHP-Git-Deploy/tree/master/codeigniter

Download and drag the following files into your application/ folder.

Code:
$ cp config/github.php application/config/
$ cp controllers/deploy.php application/controllers/

Configure your profile

open application/config/github.php file with your editor. Following is config formats.

Code:
$config['github'] = array(
    'project_name' => array(
        'branch_name' => array('base_path' => 'folder_path')
    )
);

project_name must be the same with your github project name, for example:

Your github project URL is https://github.com/appleboy/PHP-Git-Deploy

The project_name value is PHP-Git-Deploy, don't case sensitive.

Please refer the following example profiles.

Single project, Multi branch profile

Code:
array(
    'php-git-deploy' => array(
        'master' => array('base_path' => '/path/PHP-Git-Deploy_1/'),
        'develop' => array('base_path' => '/path/PHP-Git-Deploy_2/')
    )
);
Multi project, Multi branch profile

Code:
array(
    'php-git-deploy' => array(
        'master' => array('base_path' => '/path/PHP-Git-Deploy_1/'),
        'develop' => array('base_path' => '/path/PHP-Git-Deploy_2/')
    ),
    'codeigniter-my-model' => array(
        'master' => array('base_path' => '/path/CodeIgniter-MY-Model_1/'),
        'develop' => array('base_path' => '/path/CodeIgniter-MY-Model_2/')
    )
);

Setting Webhook URL

Please refer the Post-Receive Hooks Helper page

[Image: 7836097364_d7629b427c_z.jpg]