Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deployment of Laravel projects using Git webhooks

git-deploy-laravel allow for automated deployment using webhook requests from your repository's server, and automatically pulling project code using the local Git binary.
git-deploy-laravel allows for automated deployment using webhook requests from your repository's server, and automatically pulls project code using the local Git binary.

This should work out-of-the-box with Laravel 5.x using with webhooks from GitHub and GitLab servers.

Expand All @@ -25,14 +25,6 @@ Or run:

### Step 2

Add the following line to you providers in `config/app.php`:

Orphans\GitDeploy\GitDeployServiceProvider::class,

** New in Laravel 5.5 - Service provide should be automatically detected without the above change **

### Step 3

Add the _/git-deploy_ route to CSRF exceptions so your repo's host can send messages to your project.


Expand All @@ -42,7 +34,7 @@ In file in `app/Http/Middleware/VerifyCsrfToken.php` add:
'git-deploy',
];

### Step 4 Optional
### Step 3 Optional
In case you need additional action after a successful commit, you can add you own Event Listener.
For example you can write your own update script to run migrations etc.

Expand Down
36 changes: 17 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
{
"name": "orphans/git-deploy-laravel",
"description": "Helps automate the deployment of projects onto servers by utilising Git web hooks.",
"license": "MIT",
"autoload": {
"psr-4": {
"Orphans\\GitDeploy\\": "src"
}
},
"require": {
"illuminate/http": "~5",
"illuminate/config": "~5",
"illuminate/support": "~5"
},
"extra": {
"laravel": {
"providers": [
"Orphans\\GitDeploy\\GitDeployServiceProvider"
]
}
"name": "orphans/git-deploy-laravel",
"description": "Helps automate the deployment of projects onto servers by utilising Git web hooks.",
"license": "MIT",
"autoload": {
"psr-4": {
"Orphans\\GitDeploy\\": "src"
}
},
"require": {
"illuminate/support": "^5.5|^6.0|^7.0|^8.0"
},
"extra": {
"laravel": {
"providers": [
"Orphans\\GitDeploy\\GitDeployServiceProvider"
]
}
}
}
2 changes: 2 additions & 0 deletions src/http/routes.php → routes/web.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php

use Illuminate\Support\Facades\Route;

Route::post('git-deploy', 'Orphans\GitDeploy\Http\GitDeployController@gitHook');
3 changes: 1 addition & 2 deletions src/events/GitDeployed.php → src/Events/GitDeployed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ class GitDeployed
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}

}
}
2 changes: 1 addition & 1 deletion src/GitDeployServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function boot()
$this->publishes([
__dir__ . '/../config/gitdeploy.php' => config_path('gitdeploy.php')
], 'config');
$this->loadRoutesFrom(__dir__ . '/http/routes.php');
$this->loadRoutesFrom(__dir__ . '/../routes/web.php');
$this->loadViewsFrom(__dir__ . '/views', 'gitdeploy');

}
Expand Down
File renamed without changes.