* deployer added

* los basepath added
This commit is contained in:
Dávid Danyi 2017-09-15 13:26:47 +02:00
parent 863e6e502b
commit 7b83e4df9b
5 changed files with 115 additions and 2 deletions

View File

@ -9,6 +9,7 @@
},
"require": {
"php": "^7.1",
"los/basepath": "^1.0",
"roave/security-advisories": "dev-master",
"zendframework/zend-component-installer": "^1.0",
"zendframework/zend-config": "^3.1",

47
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "50100ee3d1e0aedcc8bc64b5a81c8b44",
"content-hash": "14eac04b4180a20ff231172a7ad1c5ac",
"packages": [
{
"name": "container-interop/container-interop",
@ -194,6 +194,49 @@
],
"time": "2016-12-28T00:14:17+00:00"
},
{
"name": "los/basepath",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/Lansoweb/basepath.git",
"reference": "8a40de843a4c7cf1fdac51d7e33c7dfbcfb08d29"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Lansoweb/basepath/zipball/8a40de843a4c7cf1fdac51d7e33c7dfbcfb08d29",
"reference": "8a40de843a4c7cf1fdac51d7e33c7dfbcfb08d29",
"shasum": ""
},
"require": {
"container-interop/container-interop": "~1.1",
"php": "^7.0",
"psr/http-message": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
"zendframework/zend-diactoros": "^1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"LosMiddleware\\BasePath\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Leandro Silva",
"homepage": "http://leandrosilva.info/"
}
],
"description": "PHP middleware to remove a path prefix from request uri",
"homepage": "https://github.com/lansoweb/basepath",
"time": "2016-08-27T20:56:32+00:00"
},
{
"name": "nikic/fast-route",
"version": "v1.2.0",
@ -3202,7 +3245,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^5.6 || ^7.0"
"php": "^7.1"
},
"platform-dev": []
}

View File

@ -0,0 +1,10 @@
<?php
return [
'los_basepath' => '',
'dependencies' => [
'factories' => [
LosMiddleware\BasePath\BasePath::class => LosMiddleware\BasePath\BasePathFactory::class,
],
],
];

View File

@ -14,6 +14,7 @@ use Zend\Stratigility\Middleware\ErrorHandler;
// The error handler should be the first (most outer) middleware to catch
// all Exceptions.
$app->pipe(ErrorHandler::class);
$app->pipe(LosMiddleware\BasePath\BasePath::class);
$app->pipe(ServerUrlMiddleware::class);
// Pipe more middleware here that you want to execute on every request:

58
deploy.php Normal file
View File

@ -0,0 +1,58 @@
<?php
namespace Deployer;
require 'recipe/common.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', 'https://gogs.ragnarok.yvan.hu/TSP/support-jira-graph.git');
set('shared_files', [
'config/autoload/local.php',
'config/autoload/los-basepath.local.php',
// 'config/autoload/doctrine.local.php',
]);
/*
set('shared_dirs', [
'data/persistent',
]);
*/
set('writable_dirs', []);
set('keep_releases', 3);
set('default_stage', 'production');
// Servers
host('vasgyuro.tsp')
->stage('production')
->user('edvidan')
->forwardAgent()
->set('php_service_name', 'php7.1-fpm')
->set('deploy_path', '/home/edvidan/applications/support-jira-graph');
desc('Reload PHP-FPM service');
task('php-fpm:reload', function () {
// The user must have rights for restart service
// /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
run('sudo service {{php_service_name}} reload');
}); //->onlyOn('alfheim');
after('deploy:symlink', 'php-fpm:reload');
desc('Deploy your project');
task('deploy', [
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'cleanup',
]);
after('deploy', 'success');