承接 jhoncytech/automatic-deployment 相关项目开发

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

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

jhoncytech/automatic-deployment

Composer 安装命令:

composer create-project jhoncytech/automatic-deployment

包简介

Automated deployment script through Vagrant

README 文档

README

Automated deployment script through Vagrant

Screenshot de la plantilla

 

Requirements

  • Must have installed Vagrant in your PC.

    You can download vagrant by clicking in the follow address https://www.vagrantup.com/downloads

    In vagrant make sure you have the vagrant-disksize plugin installed, if not, install it with the follow command in your local PC.

    #> vagrant plugin install vagrant-disksize
  • Must have installed Virtualbox in your PC.

    You can download virtualbox by clicking in the follow address https://www.virtualbox.org/wiki/Downloads

  • In remote server you need to point the document root of vhosts to /var/www/current like the follow image:

    That's because this script creates the necessary folders during deployment
    and the main one is current

    Vhost

     

    The script generates a structure like this where current is pointing
    to the desire deployment

    Deploy Version

     

    The script generates the deploy version in file deploy-version stored
    into /var/www/sql/

    Deploy Version

     

    All releases are stored in folder releases where you can see the folder
    that contain the html files with the deploy-version.

    Releases

     

    In the same way all .sql files are stored in sql folder where you can see the
    database version with the deploy version too.

    SQL Files

     

    Finally, you can see the scripts-data-access.sh file that stores all necessary
    data for the script work properly. This file is encrypted for security reasons.

    Script Data Access
  • Optionally you can to install composer if you want to use composer for to get the project.

    You can download and install composer following the instruction in the official web page https://getcomposer.org/download/

 

Description

This script developed with shell allows you to create a machine on a local PC by using vagrant at the same time that it deploy the local environment to remote production environment, in the same way, the script is capable of doing both "deployments and rollbacks" to the same time that makes commits to GitHub account.

 

Features

With this script you can:

  • Create a locale environment by using vangrant.
  • Deploy your local project to remote server with simple command [deploy] in your local server
  • Rollback to previous versions of lasts deployments with a simple command [undeploy] in remote server
  • You can decide how many deployments you want to keep on the remote server.
  • You can decide which version you want to rollback from a list of deployments on the remote server by using a simple [undeploy] command on the remote server.

 

Tools, software and packages used

  • Denian 9
  • Vagrant 2.2.14
  • Virtualbox 6.1
  • Shell Script
  • PHP
  • Composer
  • Apache
  • MariaDB

 

How to use it

Step-by-step installation.

  1. Create an empty private repository on GitHub where project deployments will be stored and controlled.

    • This step will only be done the first time, since it is not necessary afterwards.
    • It is very important that you know that every time you create a new project, the repository must also be new.
  1. Get the project.

    USE THE OPTION YOU WANT TO GET THE PROJECT
    OPTION 1 - GET FROM COMPOSER

    Go to where you want to create the project.

    #> cd C:\Users\User\Documents

    Create project using composer.

    #> composer create-project jhoncytech/automatic-deployment my-web

    Go to new created directory.

    #> cd my-web
    OPTION 2 - GET FROM GITHUB REPOSITORY

    Go to where you want to create the project.

    #> cd C:\Users\User\Documents

    Create a directory on your pc where the entire project will be managed.

    #> mkdir my-web

    Go to new created directory.

    #> cd my-web

    Clone from GitHub the Automated Vagrant Deployment project by JhonnyGO.

    #> git clone git@github.com:jhonnygo/automated-deployment.git .
  1. Edit the project [Vagrantfile] file.

    This file is located in the folder C:\Users\User\Documents\my-web\Vagrantfile

    It's very important that you edit the following mandatory parameters:

    • config.vm.hostname = "my-web" => Name of the host you want for your local server
    • config.vm.network = "192.168.10.10 => Private IP you want for your local server
    • vb.name = "local-my-web" => Machine name for Virtualbox

    There are more optional values, feel free to modify them according to your needs.

  1. Edit the [00-shell-script-config.sh] file

    This file is located in the folder C:\Users\User\Documents\my-web\config\scripts\00-shell-script-config.sh

    It's very important that you edit the following mandatory parameters:

    • REMOTE_IP="" It must be a public IP, since it is the IP of the remote server.
    • LOCAL_IP="192.168.10.10" It must be a private IP which is the IP of the local server used in Vagrantfile file.
    • GIT_USER_NAME="Jeff Smith" GitHub user who will perform the commits.
    • GIT_USER_EMAIL="jeff.smith@gmail.com" Email of the GitHub user who will perform the commits.
    • REPO_GITHUB_HTML="" URL in SSH format of the GitHub repository where the deployments will be made.

    NOTE: Remember that if you not indicated some password that password will be generated automatically.

  1. Create the SSH key pair to work with the project repository.

    Go to following folder of the SSH project Keys: [ssh-keys]

    #> cd C:\Users\User\Documents\wy-web\config\ssh-keys
    #> ssh-keygen -t rsa -b 4096 -C "my-web-local"
    
    • Use as name: ssh-key-local-test
    • Keep password empty:

    The above command will create your SSH key pair.

    IMPORTANT: If you already have your own key pair, you can copy and paste them into this directory.

  1. Add the public key of your local server [ssh-key-local-test.pub] on the remote server so that the local server can communicate with the remote one.

    In local server

    #> cd C:\Users\User\Documents\wy-web\config\ssh-keys
    #> cat ssh-key-local-test.pub
    

    In remote server

    #> nano ~/.ssh/authorized_keys
    

    copy your local server's public key [ssh-key-local-test.pub] at the end of the file.

  2. Add the public key of your local server [ssh-key-local-test.pub] to the GitHub account that I created earlier.

  1. Now, Its time to starts the project.

    In remote server

    #> cd C:\Users\User\Documents\wy-web
    #> vagrant up
    

Available project's commands

Local Server

  • Stop the project: #> vagrant halt
  • Start the project: #> vagrant up
  • Destroy the project: #> vagrant destroy
  • Deploy the project: #> deploy

Remote Server

  • Undeploy the project: #> undeploy

Screenshot de la plantilla

Contactos

- Mail: jhonny@jhoncytech.com
- Web: https://jhoncytech.com
---
- Mail: contacto@jhonnygo.com
- Web: https://jhonnygo.com

jhoncytech/automatic-deployment 适用场景与选型建议

jhoncytech/automatic-deployment 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 01 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 jhoncytech/automatic-deployment 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-17