guysolamour/laravel-deploy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

guysolamour/laravel-deploy

Composer 安装命令:

composer require guysolamour/laravel-deploy

包简介

Laravel deployment system built with ansible & ansistrano

README 文档

README

Packagist Packagist Packagist

This package allows you to deploy a website on a dedicated server or a VPS by installing the various tools necessary for the operation of the site and by automating the deployment process.

Prerequis

  1. Works on Unix type system (MacOs and Linux)
  2. Ubuntu Server operating system
  3. have a bash version >= 4 (you can do bash --version ) otherwise update the bash shell
  4. Instal ansible (https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
  5. Instal anistrano (https://ansistrano.com)

Installation

Install via composer

composer require guysolamour/laravel-deploy

Preparing the server

1- Connect to the server

ssh root@000.000.000.000
# 000.000.000.000 must be changed with your server ip address

2- Create a user to run the tasks

sudo useradd user -s /bin/bash -d /home/user -m -G sudo
# user must be changed with your own user

3- Add created user to sudoers file

sudo visudo
# Append user ALL=(ALL) NOPASSWD:ALL at the end of line
# user must be changed with your own user

4- Install python on the remote server

sudo apt install -y python-apt

5- Disconnect from the remote machine and copy host machine ssh key for the created user

ssh-copy-id -i ~/.ssh/id_rsa.pub user@000.000.000.000
# If you dont have generate ssh key before use sshkeygen command to generate newly key
# 000.000.000.000 must be changed with your server ip address

Scaffold

Run the scaffold command to generate the necessary base files. This command must be executed once and at the very beginning.

./vendor/bin/deploy scaffold --host 000.001.002.003 --domain domain.com --application appname

THE DIFFERENT STEPS

1- Generate the file that will contain the passwords

./vendor/bin/deploy password:create
# Enter the password that will be used for decryption
# This password must be saved in clear in the .vaultpass file
# This file must not be versioned.

2- Add theses variables with the correct data

# The deployement user password. The user created on the server.
vault_user_password: "password"

# The deployment database password
vault_database_password: "password"

# The database root user password
vault_database_root_password: "password"

# The administrator password for admin panel in local
vault_admin_local_password: "password"

# The administrator password for admin panel in production
vault_admin_production_password: "password"

# The ftp password for backup. Can be blank.
vault_ftp_password: "password"

# Copy and paste the output of *php artisan key:generate --show command
vault_app_key: "base64:appkey"

3- To modify the file containing the passwords

./vendor/bin/deploy password:edit

4- To view the contents of the file

./vendor/bin/deploy password:view

4- To delete the contents of the file

./vendor/bin/deploy password:delete

Available commands

  1. help
  2. scaffold
  3. configure:server
  4. password:create
  5. password:view
  6. password:edit
  7. password:delete
  8. run
  9. rollback
  10. db:seed
  11. db:deploy
  12. db:dump
  13. db:run
  14. db:import
  15. storage:dump
  16. storage:import
  17. storage:deploy
  18. exec
  19. dkim
  20. clean
  21. ssh
  22. env:deploy

Help

Get more informations

./vendor/bin/deploy help

Configure server

Run configure:server command to install all necessary softwares for a laravel project on the VPS (php, mysql, nginx ...).

./vendor/bin/deploy configure:server

Deploy

./vendor/bin/deploy run

Rollback

./vendor/bin/deploy rollback

Seed database

./vendor/bin/deploy db:seed

Database deploy

Copy and import local database into remote database

./vendor/bin/deploy db:deploy

Database import

Copy and import remote database into local database

./vendor/bin/deploy db:import

Database dump

Dump local database

./vendor/bin/deploy db:dump

Storage deploy

Copy and import local storage folder into remote storage folder

./vendor/bin/deploy storage:deploy

Storage import

Copy and import remote storage folder into local storage folder

./vendor/bin/deploy storage:import

Exec

Run a shell command online

./vendor/bin/deploy exec "pwd"

Dkim

Display DKIM public key

./vendor/bin/deploy dkim

Clean

Remove temporary files

./vendor/bin/deploy clean

SSH

SSH into remote project

./vendor/bin/deploy ssh

If you discover any security related issues, please email rolandassale@gmail.com instead of using the issue tracker.

Credits

This package is bootstrapped with the help of melihovv/laravel-package-generator.

guysolamour/laravel-deploy 适用场景与选型建议

guysolamour/laravel-deploy 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 06 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「deploy」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 guysolamour/laravel-deploy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 guysolamour/laravel-deploy 我们能提供哪些服务?
定制开发 / 二次开发

基于 guysolamour/laravel-deploy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-13