Git branch structure

| - master - initialization program retained the original branch | - master1. X - v1. X branch | - master2. Main process x - v2. Main branch | x - develop - | - it will be abandonedtest- | the abandoned 】 【 - uat - | the abandoned 】 【 -... Version Tag directory | | - release - history - the main - the main Tag | - 1.0.0 | - | - 1.1.0 1.0.1 | - 1.1.1 | - vnpay - custom Tag | - 1.1.0.0 | -... Deployment directory | | - dev - environment - the main - dev /testMain process environment deployment branch | - 1.0.0 | - | - 1.1.0 1.0.1 | - 1.1.1 | - vnpay - dev /test/ uat customization environment deployment branch | - 1.1.0.0 | -... | | - feature - function branch directory - js - personal function branch | - the main - 1.1.0 | - vnPay - 1.1.1.0 | -...Copy the code

Structural interpretation

Currently privatized deployment management is divided into two parts: the master version and the custom version

Main version: Vendors are willing to follow our bug fixes and feature iterations without customization requirements

Customized version: the manufacturer has customized requirements, the main version is no longer applicable, not universal, cut out separately, separate from the main version for version management

The development process

  • Major release development

    1. Prepare the Tag branch: for each major version development, cut the release branch from master corresponding to x.x, and gather it under the release/main structure with the version number +1 for development.

    2. Release /main/ X.X.X. Tag branch to subdivide function branch and environment branch:

      • [Function branch] : The function branch is maintained by individual developers under the feature/ structure
      • [Environment test branch] : Cluster in the dev/main structure, the branch is used for the deployment of dev/test environment, the naming specification is the same as the release structure, and the corresponding version number is maintained

      Note: After passing the branch test, the current environment branch is the latest Tag code

    3. Uat:

      • byEnvironment improvement and testing branchtoThe release branchDev /main/ X.X.X -> release/main/ X.X.X
      • Again byThe release branchtoThe major versionRelease /main/x.x -> master/x.x
    4. Finally, output in the form of patch packs is provided online

  • Customized version

    1. Prepare the Tag branch: Each custom build is developed in two ways:

      • Start with the current iteration of the main process(default) : the switch is executed from the master version of x.x by defaultThe release branch
      • Start customizing from the specified main process version: cuts from the relase/main version branchThe release branch

      The cut branch bundle will be developed under the release/cropx structure with the extension version +1.

    2. Development and testing: Subdivide functional branch and environment testing branch from Release/crPOX/X.X.X. Tag branch:

      • [Function branch] : The function branch is maintained by individual developers under the feature/ structure
      • [environment test branch] : bundle in the dev/cropx/ X.X.X.X structure, the branch is used for dev/test/uat environment deployment, the naming specification is the same as the release structure, and the corresponding version number is maintained

      Note: After passing the branch test, the current environment branch is the latest Tag code

    3. Online:

      • byEnvironment improvement and testing branchtoThe release branchDev /cropx/ X.X.X.X -> release/cropx/ X.X.X.X
    4. Finally, output in the form of patch packs is provided online

  • Custom versions also want to have bug fixes and feature iterations from the main version:

    Use the release/main/ X.X.X branch to find which version of the functionality you want to obtain.

Automated deployment

precondition
  • [Proprietary deployment server]
  • [Proprietary Git project]
Deployment process
  1. Variables required by the front-end script:

    • Online Branch:

      • The major version is master-x.x
      • The customized version is release/cropx/ X.X.X.X
    • Environment variables:

      • The main version uses UAT packaging scripts directly
      • The customized version uses pub package scripts and supports changing online server domain names
  2. Packaged by an automated deployment server 📦

  3. The output

Q&A

Why maintain a tag branch like Release?

Maintaining the Release branch for privatized deployments has several benefits:

1. Main version: Tag can be used as the online version record, and the version can be switched at any time for flexible use. 2. Customized versions: Customized versions are not controlled by the master version and cannot pollute the master environment. Therefore, the current Release branch is used as its own small Master branch for version maintenance to ensure its independence. 3. After the customized version is separated from the main process, it is eager to obtain the functional modules of the main process in the iterative process, and the source branch can be directly merged into the target branch.Copy the code