承接 erdmenchen/laravel-bitbucket-deploy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

erdmenchen/laravel-bitbucket-deploy

Composer 安装命令:

composer require erdmenchen/laravel-bitbucket-deploy

包简介

Deploy your Laravel app via Bitbucket pipelines and envoyer

README 文档

README

Deploy your laravel app via bitbucket pipelines and envoyer.

Important:
Be sure, that your project (migrations!) is working as expected (tests!), because there is no backup mechanism during the deployment!
Do not deploy to production only, always test releases on staging before!

Prerequisites

  • Bitbucket account
  • Bitbucket Pipeline build minutes available (the free plan has 50min per month)
  • Hosting with SSH access

Installation

You can easily install this package using Composer by running the following command:

composer require erdmenchen/laravel-bitbucket-deploy

After installation completed run the following command in order to install all required assets:

php artisan vendor:publish

Bitbucket Configuration

In order to get the build and deployment pipeline going at Bitbucket, you need to make the following steps in your Bitbucket repository:

  1. Enable Pipelines
  2. Add the repository variables: DEPLOY_HOST and DEPLOY_USER
  3. Create a new SSH key, add your host to the known hosts and copy the public key to your hosting
  4. Create the following deployment environments and set the variable DEPLOY_PATH for each:
    • Staging
    • Production

Hosting Configuration

The deployment script requires the following folder structure on the web hosting in order to work:

  • Deployment Target Folder (e.g. cool_website_staging)
    • .env (Laravel environment config file)
    • releases (each deployment will be placed here by the script in unique folders)
    • storage (Laravel storage folder)
      • framework/sessions
      • framework/views
      • framework/cache

During each deployment, the .env file and the storage folder are referenced into the current build folder via symlinks. Additionally a symlink current will be created (or updated) in the deployment folder, which points to the latest build folder.

To always point the webserver to the latest release, just create a symlink, that points on the current symlink (e.g. cool_website.com -> cool_website_staging/current/public. You don´t need to edit it during deployment. It will always point to the latest release.

Requirements

This package has the following requirements:

  • PHP 7.3 or higher
  • Laravel 6.0 or higher

How it works

This package scaffolds a Bitbucket pipeline script and a Laravel Envoyer script into your Laravel project.

When a new pipeline run is triggered (via git commit or manually) a full CI/CD (Continuous Integration/Continuous Delivery) build is executed with the following steps:

  1. Fetch source code and install PHP dependencies (Build PHP)
  2. Run phpunit and gather results - stops on any failed test (Test PHP)
  3. Install javascript dependencies via npm and build UI assets(Build Assets)
  4. Deploy to staging / production - connects to hosting via ssh and pushes build (Deploy)
    • Create manifest file with original trigger commit details
    • Create symlinks to .env and storage
    • Check Laravel health (running php artisan --version)
    • Activate build by updating the current symlink
    • Optimise, migrate and cleanup Laravel project

The last step (step 4) is only executed when triggered from a commit on develop or master branch. Feature branches are build only, they do not get deployed.

License

The GNU General Public License v3.0. Please see License File for more information.

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

erdmenchen/laravel-bitbucket-deploy 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 720 次下载、GitHub Stars 达 11, 最近一次更新时间为 2019 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 5
  • 开发语言: Blade

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-12-04