mayconbordin/laravel-http-deployer
Composer 安装命令:
composer create-project mayconbordin/laravel-http-deployer
包简介
A tool for automated deployment of Laravel applications using HTTP.
README 文档
README
A tool for automated deployment of Laravel applications using HTTP.
This library is for those that have to deploy Laravel applications on shared hosting without SSH access and don't want to use FTP or GIT.
If you want to use FTP and/or GIT check these libraries:
Remote Installation
On the server where the application is going to be deployed, you need to drop the deploy.php file at a public accessible directory (e.g. public_html) with 0644 permissions.
You will also need to create a configuration file. By default the file should be called deploy_config.ini and be located in the same directory as the script. Example configuration file:
auth_key = YOUR_AUTH_KEY
Where auth_key is a unique key that will be used for authentication. So, your configuration file should have 0640 permissions.
Local Installation
In order to install Laravel HTTP Deployer locally (development environment), just add
"mayconbordin/laravel-http-deployer": "0.1"
to your composer.json. Then run composer install or composer update.
Then in your config/app.php add
'Mayconbordin\LaravelHttpDeployer\LaravelHttpDeployerServiceProvider'
in the providers array.
Configuration
You will also need to create a file with the deployment configuration. It's a YAML file that should look something like this:
deployments: application: auth_key: AUTH_KEY version_filename: version remote: url: http://localhost endpoint: /deploy.php target: /home/user/app temp_dir: /home/user/tmp history_dir: /home/user/tmp/old_deployments local: path: . temp_dir: /tmp ignore: - .git* - bower_components - node_modules - .idea - deploy - deployment.* - storage/app/* - storage/framework/cache/* - storage/framework/sessions/* - storage/framework/views/* - storage/logs/* - .env* extra_files: 'deploy/env_file': ./.env before_scripts: - composer install --no-dev - php artisan optimize - grunt
The deployments section can have multiple entries, each one describing one deployment configuration. The auth_key is a string that will be used to authenticate the deployment with the server, choose it carefully. The version_filename is the name of the version file used to control the deployment version.
In the remote section you specify the host where the deployment is going to occurr by setting the url, whereas the endpoint points to the path where the deploy.php can be accessed externally. The target is the full path to the installation directory on the server. The temp_dir will be used for extracting the package prior to installation and the history_dir is going to store the older deployment versions.
In the local section you only specify the path to the application, the default value is the current directory (.), and the temp_dir for storing the packaged application for deployment.
Files can be excluded from the package by using the ignore list, the patterns are those from the tar command.
The extra_files is a list of key/value pairs, where the key is the current file location and the value is the location of the file in the package. You can use it to include configuration files only meant for deployment, like the .env file. You have to prefix the target location with ./.
The before_scripts can be used to run commands locally before packaging the application for deployment, like tasks for compressing CSS and JS files, removing development libraries, etc.
Obs.: all paths are relative to the current working directory. Preferably the root of your project.
Usage
Deploy
To deploy your application run:
php artisan deploy deployment.yaml
You can also choose which deployment you want to execute:
php artisan deploy deployment.yaml application
And if you only want to package the application without deploying it:
php artisan deploy --package-only deployment.yaml
Rollback
To rollback to a previous deployment version:
php artisan deploy:rollback deployment.yaml
And to rollback (or forward) to a specific version:
php artisan deploy:rollback deployment.yaml 5
You can also choose which deployment you want to rollback:
php artisan deploy deployment.yaml 5 application
Status
To see which version is deployed on the remote server as well as all available versions in the history directory:
You can also choose which deployment you want to execute:
php artisan deploy:status deployment.yaml
mayconbordin/laravel-http-deployer 适用场景与选型建议
mayconbordin/laravel-http-deployer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 125 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「http」 「laravel」 「deployment」 「shared hosting」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mayconbordin/laravel-http-deployer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mayconbordin/laravel-http-deployer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mayconbordin/laravel-http-deployer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Automated deployment template for Laravel Envoy based on Capistrano.
Morpht Development Tools
blueways deployer recipes
A Highly Opinionated Symfony3/4 Deployer Recipe
A Deployment/Change Log Schedule and Notes system for SilverStripe sites
统计信息
- 总下载量: 125
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-06