Skip to content

Commit 2ffb0ae

Browse files
committed
Initial commit
0 parents  commit 2ffb0ae

14 files changed

+957
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor
2+
composer.lock
3+
.idea
4+
test.php

.travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: php
2+
3+
php:
4+
- hhvm
5+
- 7.0
6+
- 5.6
7+
- 5.5
8+
9+
matrix:
10+
fast_finish: true
11+
allow_failures:
12+
- php: hhvm
13+
14+
sudo: false
15+
16+
install: composer install --no-interaction
17+
18+
notifications:
19+
email:
20+
on_success: always
21+
on_failure: always
22+

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
All notable changes to `webklex/laravel-git-hook` will be documented in this file.
4+
5+
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
6+
7+
## [UNRELEASED]
8+
9+
### Added
10+
- new laravel-git-hook package

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Webklex
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2017 Malte Goldenbaum <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Git hook deployment made for Laravel
2+
3+
[![Latest Version on Packagist][ico-version]][link-packagist]
4+
[![Software License][ico-license]](LICENSE.md)
5+
[![Build Status][ico-travis]][link-travis]
6+
[![Total Downloads][ico-downloads]][link-downloads]
7+
8+
## Install
9+
10+
Via Composer
11+
12+
``` bash
13+
$ composer require webklex/laravel-git-hook
14+
```
15+
16+
## Setup
17+
18+
Add the service provider to the providers array in `config/app.php`.
19+
20+
``` php
21+
'providers' => [
22+
Webklex\GitHook\Providers\LaravelServiceProvider::class,
23+
];
24+
```
25+
26+
## Publishing
27+
28+
You can publish everything at once
29+
30+
``` php
31+
php artisan vendor:publish --provider="Webklex\GitHook\Providers\LaravelServiceProvider"
32+
```
33+
34+
or you can publish groups individually.
35+
36+
``` php
37+
php artisan vendor:publish --provider="Webklex\GitHook\Providers\LaravelServiceProvider" --tag="config"
38+
```
39+
40+
## Usage
41+
42+
This library is designed to handle the automatic deployment by git hooks
43+
as simple as possible. There isn't much todo to get started: just add the
44+
Provider and edit the `config/git-hook.php` file to make it fit your needs.
45+
46+
47+
Custom configuration can be made within the config/git-hook.php file:
48+
```
49+
/*
50+
|--------------------------------------------------------------------------
51+
| Email recipients
52+
|--------------------------------------------------------------------------
53+
|
54+
| The email address and name that notification emails will be sent to.
55+
| Leave the array empty to disable emails.
56+
|
57+
| [
58+
| ['name' => 'Admin', 'address' => '[email protected]'],
59+
| ...
60+
| ]
61+
|
62+
*/
63+
'email_recipients' => [],
64+
65+
66+
/*
67+
|--------------------------------------------------------------------------
68+
| Email sender
69+
|--------------------------------------------------------------------------
70+
|
71+
| The email address and name that notification emails will be sent from.
72+
| This will default to the sender in config(mail.from) if left null.
73+
|
74+
*/
75+
'email_sender' => ['address' => null, 'name' => null],
76+
77+
78+
/*
79+
|--------------------------------------------------------------------------
80+
| Repository path
81+
|--------------------------------------------------------------------------
82+
|
83+
| This the root path of the Git repository that will be pulled. If this
84+
| is left empty the script will try to determine the directory itself
85+
| but looking for the project's .env file it's nearby .git directory.
86+
|
87+
| No trailing slash
88+
|
89+
*/
90+
'repo_path' => '',
91+
92+
93+
/*
94+
|--------------------------------------------------------------------------
95+
| Allowed sources
96+
|--------------------------------------------------------------------------
97+
|
98+
| A request will be ignored unless it comes from an IP listed in this
99+
| array. Leave the array empty to allow all sources.
100+
|
101+
| This is useful for a little extra security if you run your own Git
102+
| repo server.
103+
|
104+
*/
105+
'allowed_sources' => [],
106+
107+
108+
/*
109+
|--------------------------------------------------------------------------
110+
| Remote name
111+
|--------------------------------------------------------------------------
112+
|
113+
| The name of the remote repository to pull the changes from
114+
|
115+
*/
116+
'remote' => 'origin',
117+
118+
119+
/*
120+
|--------------------------------------------------------------------------
121+
| Git binary path
122+
|--------------------------------------------------------------------------
123+
|
124+
| The full path to the system git binary. e.g. /usr/bin/git
125+
|
126+
| Leave blank to let the system detect using the current PATH variable
127+
|
128+
*/
129+
'git_path' => '',
130+
131+
132+
/*
133+
|--------------------------------------------------------------------------
134+
| Logger file name
135+
|--------------------------------------------------------------------------
136+
|
137+
| The filename of the logfile which will be used to store deployment
138+
| information.
139+
|
140+
| By default it will use: git-hook
141+
|
142+
| The log file will be placed within the storage/log/ directory.
143+
|
144+
*/
145+
'logfile' => 'git-hook',
146+
147+
148+
/*
149+
|--------------------------------------------------------------------------
150+
| Url parameter
151+
|--------------------------------------------------------------------------
152+
|
153+
| Please specify a url parameter. The router will adapt to it automatically.
154+
|
155+
| Example: if you enter 'another-git-hook'
156+
| It will be transformed into: https://your-domain.tld/another-git-hook
157+
|
158+
*/
159+
'url' => 'git-hook'
160+
```
161+
162+
## Change log
163+
164+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
165+
166+
## Testing
167+
168+
``` bash
169+
$ composer test
170+
```
171+
172+
## Security
173+
174+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
175+
176+
## Credits
177+
178+
- [Webklex][link-author]
179+
- All Contributors
180+
181+
## License
182+
183+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
184+
185+
[ico-version]: https://img.shields.io/packagist/v/Webklex/laravel-git-hook.svg?style=flat-square
186+
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
187+
[ico-travis]: https://img.shields.io/travis/Webklex/laravel-git-hook/master.svg?style=flat-square
188+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/Webklex/laravel-git-hook.svg?style=flat-square
189+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Webklex/laravel-git-hook.svg?style=flat-square
190+
[ico-downloads]: https://img.shields.io/packagist/dt/Webklex/laravel-git-hook.svg?style=flat-square
191+
192+
[link-packagist]: https://packagist.org/packages/Webklex/laravel-git-hook
193+
[link-travis]: https://travis-ci.org/Webklex/laravel-git-hook
194+
[link-scrutinizer]: https://scrutinizer-ci.com/g/Webklex/laravel-git-hook/code-structure
195+
[link-code-quality]: https://scrutinizer-ci.com/g/Webklex/laravel-git-hook
196+
[link-downloads]: https://packagist.org/packages/Webklex/laravel-git-hook
197+
[link-author]: https://github.com/webklex

composer.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "webklex/laravel-git-hook",
3+
"type": "library",
4+
"description": "Laravel Git Hook",
5+
"keywords": [
6+
"webklex",
7+
"laravel",
8+
"git",
9+
"git hook",
10+
"hook",
11+
"laravel-git-hook"
12+
],
13+
"homepage": "https://github.com/webklex/laravel-git-hook",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Malte Goldenbaum",
18+
"email": "[email protected]",
19+
"role": "Developer"
20+
}
21+
],
22+
"require": {
23+
"php": ">=5.5.9",
24+
"illuminate/http": "~5",
25+
"illuminate/config": "~5"
26+
},
27+
"autoload": {
28+
"psr-4": {
29+
"Webklex\\GitHook\\": "src/GitHook"
30+
}
31+
},
32+
"scripts": {
33+
"test": "phpunit"
34+
},
35+
"extra": {
36+
"branch-alias": {
37+
"dev-master": "1.0-dev"
38+
}
39+
},
40+
"minimum-stability": "dev",
41+
"prefer-stable": true
42+
}

phpunit.xml.dist

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Helpers Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
</phpunit>

0 commit comments

Comments
 (0)