https://github.com/appleboy/php-git-deploy
Git Deployment with PHP
https://github.com/appleboy/php-git-deploy
Last synced: 9 months ago
JSON representation
Git Deployment with PHP
- Host: GitHub
- URL: https://github.com/appleboy/php-git-deploy
- Owner: appleboy
- Created: 2012-08-21T13:56:52.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-05-16T02:17:17.000Z (over 11 years ago)
- Last Synced: 2025-04-10T08:31:45.653Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 167 KB
- Stars: 35
- Watchers: 8
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP-Git-Deploy
======================
Using `Post-Receive Hooks` to deploy muliple projects automatically. [](http://travis-ci.org/appleboy/PHP-Git-Deploy)
Ref: https://developer.github.com/webhooks/
Requirements
======================
PHP-Git-Deploy works with PHP 5.3 or later.
Installation via Composer
======================
Create a composer.json file in your project root and use it to define simply your dependencies:
```
{
"require": {
"appleboy/php-git-deploy": "1.0.*"
}
}
```
Then install Composer in your project (or download the composer.phar directly):
$ curl -s http://getcomposer.org/installer | php
And finally ask Composer to install the dependencies:
$ php composer.phar install
Installation/Usage
======================
Download files
----------------------
Download and drag the following files into your `application/` folder.
$ cp -r src/Web your_www/
Configure your profile
----------------------
open `src/Web/config.php` file with your editor. Following is config formats.
```php
$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
```php
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
```php
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/')
)
);
```
Create New index.php
----------------------
Create new file `your_www/Web/index.php`, copy the following source code and paste into index.php file.
```php
index();
```
Setting Webhook URL
----------------------
Please refer the [Post-Receive Hooks Helper](https://help.github.com/articles/post-receive-hooks) page

Author
======================
Bo-Yi Wu (appleboy)