Detailed introduction of environments and branches and their associations (development, testing, staging, production)


foreword

In modern software development, the development and deployment of front-end projects often involve multiple environments, including pre、pro、dev和test环境. These environments play an important role 不同的阶段和不同的需求below . This article will delve into the role and significance of these environments in front-end projects.


1. Development environment (dev)

开发环境: The development environment is the environment where developers work 软件开发和调试. In a development environment, developers can proceed quickly 代码编写、调试和测试. Developers can use local development tools and simulated data for development. At this point, developers can merge feature branches together for use in 快速验证功能和调试代码.

In the development environment, rapid functional verification and debugging can be performed in order to fix problems in time and iterative development
is the most advanced environment for code versions.

2. Test environment (test)

The test environment is the environment used for software testing, provided to 测试人员使用. In the test environment, testers can perform tests on the software 全面的功能测试、性能测试、兼容性测试. The test environment is usually a separate server, similar to the real production environment. In the test environment, various types of tests can be performed to find and fix problems in the software and to ensure the quality and stability of the software.

3. Pre-release environment (pre)

The staging environment is 最终验证和准备上线the environment used for progress. In the pre-release environment, developers and operators can perform final verification and tuning of the software. The staging environment is usually similar to the production environment and uses real production data. In the pre-release environment, some pre-launch functional tests, performance tests, and compatibility tests can be carried out to ensure that the software is perfect before it goes online 稳定性和可靠性.

  • In the pre-release environment, grayscale testing is required to
    test and verify the new version with a limited user group before the software is officially released. Use this to verify the new version 在真实环境中的稳定性、性能和用户体验. Through the grayscale test, problems in the new version can be discovered and solved in time, reducing the risk of going online. The results and feedback of grayscale verification can also help developers and operation and maintenance personnel 问题排查和优化to improve the quality and stability of the software.

4. Production environment (pro)

The production environment is 真正对外提供服务的环境and is the environment that users ultimately access and use. In a production environment, tested and validated software is deployed 稳定版本. A production environment is usually required 高可用性、高性能和安全性. In a production environment, access to interfaces and data needs to be strictly controlled, monitored and logged to ensure stable system operation and data security.

Five, the relationship between the environment and branches

There is a close relationship between environments and branches. Environments are usually used to specify 不同的部署环境, such as development environment, test environment, pre-release environment, and production environment. And branches are used for 管理不同的代码版本和开发任务.

Specifically, environments can correspond to different branches, so that different development and testing tasks can be performed in different environments.

For example: in the initial stage of project creation, dev, test, pre, pro branches and n feature branches were cut from the master main branch. When the feature branch is completed, it can be merged into the dev branch and then automatically deployed to the dev server. for debugging. Then merge and deploy with the test branch, and test bugs for testers...
insert image description here

  • The development environment can correspond to the development branch, which is used for developers to write and debug code.
  • The test environment can correspond to a test branch, and is used by testers to execute test cases and verify functions.
  • The pre-release environment can correspond to the pre-release branch, which is used for grayscale testing and verification of new versions of software or functions.
  • The production environment can correspond to the main branch and is used to deploy stable versions of the software.

通过将环境与分支进行对应,使开发人员和测试人员在不同的环境中并行工作,而不会相互干扰。每个环境都可以独立运行,使用相应的分支代码。

What we are doing in actual development yarn serve-devis actually replacing the step of automatic deployment (running the project in the local server), but the requested data is still the data in the development environment


Summarize

Four stages in front-end project development: 开发->测试->预发布->生产, dev环境是开发环境,为开发人员提供快速的编码、调试和测试环境. test环境是测试环境,用于全面测试和验证软件的功能、性能和兼容性. pre环境作为一个中间环境,可以进行灰度测试和验证新版本的软件或功能. pro环境是生产环境,部署稳定版本的软件,确保系统的高可用性、高性能和安全性.

The reasonable use and management of these environments can help developers and testers to carry out effective development and testing work at different stages and under different requirements. They provide an orderly process for software development and deployment, and ensure software quality and stability. By in-depth understanding and rational use of these environments, the development and testing process of front-end projects will be more efficient and reliable.

In short, different environments are used to meet the development, testing and verification of different stages and different requirements, and to ensure data security, accuracy and environmental isolation. This improves the efficiency and quality of software development while protecting the security and privacy of user data.

Mapping environments to branches enables developers and testers to work in parallel on different environments without interfering with each other. Each environment can be run independently, using the corresponding branch code.

Guess you like

Origin blog.csdn.net/m0_57524265/article/details/132240859