lianmafutra/deploy
最新稳定版本:v1.8
Composer 安装命令:
composer require lianmafutra/deploy
包简介
Laravel Git FTP Deploy
README 文档
README
A Simple Package for Deployment Laravel App with Git FTP Server Method and SSH Server, Easy Configuration, Rollback Deploy, CI/CD
Requirement
Before using this package you must install and running GIT-FTP in your Local System https://github.com/git-ftp/git-ftp](https://github.com/git-ftp/git-ftp/blob/master/INSTALL.md
Installation
Require this package with composer. It is recommended to only require the package for development.
- Install with Composer
composer require lianmafutra/deploy --dev
- First publish config and console command into your app directory', by running the following command:
php artisan vendor:publish --provider="LianMafutra\Deploy\LibraryServiceProvider" --tag=deploy --force
will be create file : app/Console/Commands/Deploy.php , app/Console/Commands/DeploySetup.php, config/deploy.php
Package Configuration
- In your
.envfile, add the your SSH server host production and FTP account :
#Sample Configuration DEPLOY_HOST=103.31.xx.xx DEPLOY_PORT=22 DEPLOY_PATH="/www/wwwroot/myproject/" DEPLOY_USER=root DEPLOY_PASS=ssh_password FTP_URL=103.31.xx.xx FTP_USER=ftp_user FTP_PASS=ftp_pass
- Run Command Setup, to test configuration :
php artisan deploy:setup
Setup is complete !
- you can custom command deploy in
config/deploy.php, default command like this :
'command-first-deploy' => [
'composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev',
'php artisan down',
'php artisan optimize',
'php artisan storage:link',
'php artisan migrate --force',
'php artisan auth:clear-resets',
'php artisan view:clear',
'php artisan view:cache',
'php artisan up'
],
'command-deploy' => [
'composer install --prefer-dist --no-scripts -q -o',
'php artisan down',
'php artisan optimize',
'php artisan view:clear',
'php artisan view:cache',
'php artisan up'
],
'command-optimize' => [
'php artisan down',
'php artisan optimize',
'php artisan view:clear',
'php artisan view:cache',
'php artisan up'
]
Usage
- Run Command Terminal :
php artisan deploy
- Terminal Show Option, Select option with type number :
- [1]
First Deploy: First Upload Project to server - [2]
Deploy Push: Push New Commit file with GIT FTP and Auto run command through SSH server with commandphp artisan down,php artisan optimize,php artisan view:clear,php artisan view:cachefinallyphp artisan up - [3]
Only Optimize: No Push commit, only run optimize in production - [4]
Rollback Previous: Rollback last commit in GIT locally and push to server production, you can fix in local with default branch and push again after fix
Note
If you have error/failed to first git ftp init or first deploy, you must check this pull request git-ftp core error fix ( out of memory curl ), open git-ftp file and change it like this pull request git-ftp/git-ftp#638
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
统计信息
- 总下载量: 693
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-28