Code branch environment deployment method and apparatus, and electronic device
By using the console to pull target branches and build pipelines in large-scale team collaborative development, the deployment of code branch environments is automated, solving the problems of cumbersome deployment of code branch environments and low resource utilization in existing technologies, thus improving development efficiency and server utilization.
Patent Information
- Application Number
- PCT/CN2023/139993
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-29
- Filing Date
- 2023-12-19
- Publication Date
- 2024-12-05
AI Technical Summary
In large-scale team collaborative development, existing technologies lack efficient and automated methods for deploying code branch environments, leading to problems such as mutual interference of logic, low utilization of server resources, and low development efficiency during feature iteration.
By receiving branch environment deployment instructions, pulling the target branch based on the console and allocating the branch database, building the pipeline, and binding idle branch servers, the system achieves automated deployment and management of the target branch, including pipeline initialization, release, and automatic resource reclamation.
It enabled automated deployment of branch servers, improving the team's R&D efficiency, increasing server utilization, and reducing hardware expenses.
Smart Images

Figure CN2023139993_05122024_PF_FP_ABST
Abstract
Description
A method, device and electronic device for deploying a code branch environment Technical Field
[0001] The present application relates to the technical field of electronic digital data processing, and in particular to a method, device and electronic device for deploying a code branching environment. Background Art
[0002] Git is an open-source distributed version control system that efficiently and quickly manages versions of projects from small to very large. The mainstream Git branch management workflow typically involves pulling down different code feature branches or bug fix branches for testing based on product iteration requirements. As teams grow, the number of features that require parallel iteration increases, leading to a growing number of Git branches.
[0003] Currently, functional self-testing and joint debugging environments are shared across teams, meaning that teams share a single self-testing and joint debugging environment. Due to the parallel iteration of product features, this approach inevitably leads to cross-functional logic interactions, potentially hiding significant bugs. Furthermore, requiring R&D personnel to independently deploy independent test environments for each feature iteration reduces overall team development efficiency and easily creates numerous abandoned environments, impacting server resource utilization. Consequently, there is currently no efficient, automated method for deploying branch environments for large-scale collaborative development.
[0004] Summary of the Invention
[0005] In order to solve the above problems, the embodiments of the present application provide a method, device and electronic device for deploying a code branch environment. In a first aspect, the embodiments of the present application provide a method for deploying a code branch environment, the method comprising:
[0006] When receiving a branch environment deployment instruction, pull the target branch based on the console, and allocate a branch database for the target branch based on the console;
[0007] Building a pipeline based on the branch database, and binding the target branch to the branch database;
[0008] Obtain an idle branch server, and bind the idle branch server to a target branch;
[0009] The target branch is called to initialize the pipeline and generate deployment completion information.
[0010] Preferably, after constructing the pipeline based on the branch database, the method further includes:
[0011] Determining a construction result of the pipeline;
[0012] When the pipeline is successfully built, execute the next step;
[0013] When the pipeline construction fails, the deployment task is terminated and first failure information is generated.
[0014] Preferably, calling the target branch to initialize the pipeline includes:
[0015] The branch service of the target branch is called in the pipeline, and the pipeline is initialized and released based on the branch service.
[0016] Preferably, after calling the target branch to initialize the pipeline, the method further includes:
[0017] Determining the release result of the pipeline;
[0018] When the pipeline is successfully released, the next step is executed;
[0019] When the pipeline release fails, the target branch is untied from the idle branch server and the branch database respectively, the target branch is merged into the trunk branch, and a second failure message is generated.
[0020] Preferably, the method further comprises:
[0021] When the code corresponding to the target branch is updated, the pipeline is updated and released;
[0022] When the table structure corresponding to the branch database has a new field, the branch database is updated.
[0023] Preferably, the method further comprises:
[0024] When a development completion instruction corresponding to the target branch is received, the pipeline is closed and destroyed to stop the service process of the branch service in the pipeline;
[0025] The target branch is respectively unbound from the idle branch server and the branch database, and the branch database is deleted.
[0026] Preferably, the method further comprises:
[0027] Obtaining a login log of the target branch, and determining a cumulative number of days the user has not logged in based on the login log;
[0028] When the accumulated number of days without login is greater than the preset number of days, the pipeline is closed and destroyed to stop the service process of the branch service in the pipeline, and the binding of the target branch with the idle branch server and branch database is released respectively, and the branch database is retained.
[0029] In a second aspect, an embodiment of the present application provides a deployment device for a code branch environment, the device comprising:
[0030] A receiving module, configured to, upon receiving a branch environment deployment instruction, pull a target branch based on the console and allocate a branch database to the target branch based on the console;
[0031] A construction module, configured to construct a pipeline based on the branch database and bind the target branch to the branch database;
[0032] A binding module, configured to obtain an idle branch server and bind the idle branch server to a target branch;
[0033] The initialization module is used to call the target branch to initialize the pipeline and generate deployment completion information.
[0034] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, the steps of the method provided in the first aspect or any possible implementation of the first aspect are implemented.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect or any possible implementation of the first aspect.
[0036] The beneficial effects of this invention include: automating branch server deployment frees team developers from the complex and repetitive work of server deployment, allowing them to focus on product functionality iteration, thereby improving the team's R&D efficiency and resolving the issues of a large number of branch test environments and cumbersome deployment. It also achieves higher server utilization, automatically reclaiming unused servers, and reducing the team's hardware server expenses. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] FIG1 is a flow chart of a method for deploying a code branch environment provided in an embodiment of the present application;
[0039] FIG2 is a schematic diagram of the structure of a deployment device for a code branch environment provided in an embodiment of the present application;
[0040] FIG3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. In the following introduction, the terms "first" and "second" are only used for descriptive purposes and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments described. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, even though the embodiment may not be clearly described in the following text.
[0042] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the elements described without departing from the scope of the present application. Various examples may appropriately omit, replace, or add various processes or components. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted, or combined. In addition, features described in some examples may be combined in other examples.
[0043] See Figure 1, which is a flow chart of a method for deploying a code branch environment provided by an embodiment of the present application. In the embodiment of the present application, the method includes:
[0044] S101. When a branch environment deployment instruction is received, a target branch is pulled based on the console, and a branch database is allocated to the target branch based on the console.
[0045] The execution entity of this application can be a cloud server.
[0046] In one embodiment of the present application, if the user, that is, the R&D personnel in the team, needs to build a new branch environment for self-testing / joint debugging, the corresponding operation will be performed on the terminal to generate a branch environment deployment instruction. After receiving the branch environment deployment instruction, the cloud server believes that the branch environment needs to be deployed, and it will pull out a target branch from the main branch through the console and allocate a corresponding branch database for the target branch. The purpose of pulling the target branch is to fork and save the overall process of the modification record without being affected by other branches. Since the target branch is a branch pulled out from the main branch for iterative independent testing, its initial data and initial functions by default should be the same as the data and functions corresponding to the main branch, so the data allocated in the branch database can be determined based on the data in the main database corresponding to the main branch.
[0047] The console is a command-line interface provided by a computer operating system. It can be used to debug programs, interact with users, log information, enter commands, and view program output. Typically, the console can be used in the operating system's terminal window or in development tools such as browser consoles and integrated development environments (IDEs). It is a commonly used development tool.
[0048] S102: Building a pipeline based on the branch database, and binding the target branch to the branch database.
[0049] In one embodiment of the present application, after the branch database is allocated, the corresponding pipeline will be constructed based on the table structure data in the branch database. After the pipeline is constructed, the target branch will be bound to the branch database configured for it, so that changes in the target branch in subsequent processes can be reflected in the data in the branch database.
[0050] Pipelining is a quasi-parallel processing technology that overlaps multiple instructions during program execution. Each component simultaneously processes different instructions, working on different parts of multiple instructions simultaneously to improve component utilization and average instruction execution speed. It is a compile-time scheduling technique that overlaps subsequent loop iterations to exploit operation-level parallelism.
[0051] In one possible implementation, after constructing the pipeline based on the branch database, the method further includes:
[0052] Determining a construction result of the pipeline;
[0053] When the pipeline is successfully built, execute the next step;
[0054] When the pipeline construction fails, the deployment task is terminated and first failure information is generated.
[0055] In one embodiment of the present application, after the pipeline is built, it is also necessary to judge the construction result of the pipeline. The pipeline may fail to build due to problems such as node errors and system reasons. If the pipeline construction fails, it is meaningless to continue with the subsequent environment deployment, so the currently ongoing deployment task will be ended, and a first failure message will be generated and sent to the user, so as to inform the user through the first failure message that the pipeline construction failure caused the deployment task to fail and end. Among them, the node error may be caused by different node versions configured in different environments. System reasons may be that the branch test environment system is Linux, while the local environment system is window.
[0056] S103: Acquire an idle branch server, and bind the idle branch server to a target branch.
[0057] In one embodiment of the present application, after completing the construction of the pipeline and binding the branch database to the target branch, an idle branch server that is not currently in working state will be obtained from the server, and the idle branch server will be bound to the target branch, so that the idle branch server will be used as the server for this test environment.
[0058] S104: Call the target branch to initialize the pipeline and generate deployment completion information.
[0059] In one embodiment of the present application, the aforementioned process simply constructs a pipeline based on the assigned branch database. In order to actually adapt to the target branch and deploy a branch test environment, the service process corresponding to the target branch will be called and the data will be loaded into the memory to initialize the pipeline. After initialization is completed, a deployment completion message will be generated and sent to the user terminal to inform the user that the environment has been deployed and R&D work can be carried out. The entire process above will be automatically executed and implemented, without the user having to personally deploy the server environment, thereby improving the overall processing efficiency of the team.
[0060] In one embodiment, calling the target branch to initialize the pipeline includes:
[0061] The branch service of the target branch is called in the pipeline, and the pipeline is initialized and released based on the branch service.
[0062] In one embodiment of this application, a branch service is called to replace the pipeline template with information such as the environment name and service version, allowing the pipeline to truly adapt to the branch service of the target branch, completing the pipeline initialization and thus implementing the branch environment deployment of the target branch. Users can use the pipeline and idle branch servers to develop new branch features or debug bugs.
[0063] In one embodiment, after calling the target branch to initialize the pipeline, the method further includes:
[0064] Determining the release result of the pipeline;
[0065] When the pipeline is successfully released, the next step is executed;
[0066] When the pipeline release fails, the target branch is untied from the idle branch server and the branch database respectively, the target branch is merged into the trunk branch, and a second failure message is generated.
[0067] In one embodiment of the present application, in order to implement an online delivery process for application promotion between multiple environments, it is necessary to publish the initialized pipeline. Therefore, it is also necessary to determine the release result of the pipeline to determine whether the pipeline is successfully released. For example, if the "Gathering Facts" task in Ansible has been obtaining information on the target machine, and the target machine has not returned content due to an error in the file mounting system, the pipeline release will fail. In the case of pipeline release failure, it is considered that the environment deployment has failed. At this time, the target branch will be unbound from the idle branch server and branch database, and the target branch will be merged back to the main branch. In addition, a second failure message will be generated and sent to the user to inform the user through the second failure message that the failure of the pipeline release has caused the deployment task to fail and end.
[0068] In one embodiment, the method further comprises:
[0069] When the code corresponding to the target branch is updated, the pipeline is updated and released;
[0070] When the table structure corresponding to the branch database has a new field, the branch database is updated.
[0071] In one embodiment of the present application, after the environment is deployed, new code may be generated during the user's R&D process of iterating functionality on the target branch within that environment. When a code update is detected, the service version corresponding to the updated code is determined, and the pipeline is then updated and released based on that service version. Similarly, if new fields are added to the corresponding table structure of the database during R&D, the branch database will also be updated.
[0072] In one embodiment, the method further comprises:
[0073] When a development completion instruction corresponding to the target branch is received, the pipeline is closed and destroyed to stop the service process of the branch service in the pipeline;
[0074] The target branch is respectively unbound from the idle branch server and the branch database, and the branch database is deleted.
[0075] In one embodiment of the present application, if the user completes the research and development of the target branch, the user will perform corresponding operations and generate a development completion instruction. When the cloud server receives the development completion instruction, it will consider that the research and development of the target branch has been completed, enter the destruction process, and unbind the bound resources. Specifically, the service process of the branch service will be stopped, and then the binding relationship between the target branch and the server and database will be released, and the branch database related resources will be deleted. After unbinding, the idle branch server will be restored to an idle state to allow subsequent new branches to use it.
[0076] In one embodiment, the method further comprises:
[0077] Obtaining a login log of the target branch, and determining a cumulative number of days the user has not logged in based on the login log;
[0078] When the accumulated number of days without login is greater than the preset number of days, the pipeline is closed and destroyed to stop the service process of the branch service in the pipeline, and the binding of the target branch with the idle branch server and branch database is released respectively, and the branch database is retained.
[0079] In one embodiment of the present application, R&D personnel are required, in principle, to destroy the branch in a timely manner after development is completed to release server resources, but in actual situations, R&D personnel often forget to destroy it. For this reason, in order to minimize the waste of resources, especially server resources, to the greatest extent possible, an automatic recycling process for branch servers is also provided. Specifically, the decision agent deployed on each branch server will retrieve the login log of the branch service to determine how many days no user has logged into each branch test environment. If the user has not logged in for more than a preset number of days, the branch server will be automatically recycled. In addition, considering that in some cases, R&D personnel do need to use the branch, the branch database will not be deleted in the destruction process of the recycled server. In this way, even if subsequent developers want to restore the branch server, they can restore it quickly.
[0080] The following will describe in detail the deployment device for the code branching environment provided by the embodiment of the present application in conjunction with Figure 2. It should be noted that the deployment device for the code branching environment shown in Figure 2 is used to execute the method of the embodiment shown in Figure 1 of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the embodiment shown in Figure 1 of the present application.
[0081] Please refer to Figure 2, which is a schematic diagram of the structure of a deployment device for a code branch environment provided by an embodiment of the present application. As shown in Figure 2, the device includes:
[0082] The receiving module 201 is configured to, upon receiving a branch environment deployment instruction, pull a target branch based on the console and allocate a branch database for the target branch based on the console;
[0083] A construction module 202 is used to construct a pipeline based on the branch database and bind the target branch to the branch database; a binding module 203 is used to obtain an idle branch server and bind the idle branch server to the target branch;
[0084] The initialization module 204 is used to call the target branch to initialize the pipeline and generate deployment completion information.
[0085] In one embodiment, the construction module 202 further includes:
[0086] A first determining unit, configured to determine a construction result of the pipeline;
[0087] A first judgment unit, configured to execute the next step when the pipeline is successfully constructed;
[0088] The second judgment unit is used to end the deployment task and generate first failure information when the pipeline construction fails.
[0089] In one embodiment, the initialization module 204 includes:
[0090] An initialization unit is used to call the branch service of the target branch in the pipeline, initialize and publish the pipeline based on the branch service.
[0091] In one embodiment, the initialization module 204 further includes:
[0092] A second determining unit, configured to determine a publishing result of the pipeline;
[0093] A third judgment unit is used to execute the next step when the pipeline is successfully released;
[0094] The fourth judgment unit is used to unbind the target branch from the idle branch server and the branch database respectively, merge the target branch into the trunk branch, and generate second failure information when the pipeline fails to be released.
[0095] In one embodiment, the device further comprises:
[0096] A first judgment module is configured to update and release the pipeline when the code corresponding to the target branch is updated;
[0097] The second judgment module is configured to update the branch database when a table structure corresponding to the branch database has a new field.
[0098] In one embodiment, the device further comprises:
[0099] A first destruction module is configured to close and destroy the pipeline upon receiving a development completion instruction corresponding to the target branch, so as to stop the service process of the branch service in the pipeline;
[0100] The deletion module is used to respectively unbind the target branch from the idle branch server and the branch database, and delete the branch database.
[0101] In one embodiment, the device further comprises:
[0102] An acquisition module, configured to acquire a login log of the target branch and determine a cumulative number of days the user has not logged in based on the login log;
[0103] The second destruction module is used to close and destroy the pipeline when the cumulative number of days without login is greater than the preset number of days, so as to stop the service process of the branch service in the pipeline, and respectively unbind the target branch from the idle branch server and branch database, and retain the branch database.
[0104] Those skilled in the art will clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently perform or cooperate with other components to perform specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0105] Each processing unit and / or module in the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0106] Referring to Figure 3, which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement the method in the embodiment shown in Figure 1. As shown in Figure 3, the electronic device 300 may include: at least one central processing unit 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.
[0107] The communication bus 302 is used to implement the connection and communication between these components.
[0108] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0109] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0110] The central processing unit 301 may include one or more processing cores. The central processing unit 301 utilizes various interfaces and circuits to connect various components within the entire electronic device 300. It executes instructions, programs, code sets, or instruction sets stored in the memory 305, and accesses data stored in the memory 305 to perform various functions and process data for the terminal 300. Optionally, the central processing unit 301 may be implemented using at least one hardware form selected from the group consisting of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The central processing unit 301 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display; and the modem handles wireless communications. It is understood that the modem may not be integrated into the central processing unit 301 and may be implemented as a separate chip.
[0111] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be at least one storage device located away from the aforementioned central processing unit 301. As shown in Figure 3, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and program instructions.
[0112] In the electronic device 300 shown in FIG3 , the user interface 303 is mainly used to provide an input interface for the user and obtain user input data; and the central processing unit 301 can be used to call the deployment application of the code branch environment stored in the memory 305 and specifically perform the following operations:
[0113] When receiving a branch environment deployment instruction, pull the target branch based on the console, and allocate a branch database for the target branch based on the console;
[0114] Building a pipeline based on the branch database, and binding the target branch to the branch database;
[0115] Obtain an idle branch server, and bind the idle branch server to a target branch;
[0116] The target branch is called to initialize the pipeline and generate deployment completion information.
[0117] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0118] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0119] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0122] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0124] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0125] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure herein, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art that are not recorded in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A deployment method for a code branch environment, It is characterized in that The method comprises: When receiving a branch environment deployment instruction, pull the target branch based on the console, and allocate a branch database for the target branch based on the console; Building a pipeline based on the branch database, binding the target branch to the branch database; Acquire an idle branch server, and bind the idle branch server to a target branch; The target branch is called to initialize the pipeline and generate deployment completion information.
2. The method according to claim 1, It is characterized in that After the pipeline is constructed based on the branch database, the method further includes: Determining a construction result of the pipeline; When the pipeline is successfully built, execute the next step; When the pipeline construction fails, the deployment task is terminated and first failure information is generated.
3. The method according to claim 1, It is characterized in that The calling of the target branch to initialize the pipeline includes: The branch service of the target branch is called in the pipeline, and the pipeline is initialized and released based on the branch service.
4. The method according to claim 3, It is characterized in that After calling the target branch to initialize the pipeline, the method further includes: Determining a release result of the pipeline; When the pipeline is successfully released, the next step is executed; When the pipeline release fails, the target branch is unbound from the idle branch server and the branch database respectively, the target branch is merged into the trunk branch, and the second failure information is generated.
5. The method according to claim 1, It is characterized in that The method further comprises: When the code corresponding to the target branch is updated, the pipeline is updated and released; When the table structure corresponding to the branch database has a new field, the branch database is updated.
6. The method according to claim 1, It is characterized in that The method further comprises: When receiving a development completion instruction corresponding to the target branch, closing and destroying the pipeline to stop the service process of the branch service in the pipeline; The target branch is respectively unbound from the idle branch server and the branch database, and the branch database is deleted.
7. The method according to claim 1, It is characterized in that The method further comprises: Obtaining a login log of the target branch, and determining a cumulative number of days the user has not logged in based on the login log; When the accumulated number of days without logging in is greater than the preset number of days, the pipeline is closed and destroyed to stop the service process of the branch service in the pipeline, and the binding of the target branch with the idle branch server and branch database is released respectively, and the branch database is retained.
8. A deployment device for a code branch environment, It is characterized in that The device comprises: A receiving module, configured to pull a target branch based on the console when receiving a branch environment deployment instruction, and allocate a branch database to the target branch based on the console; A construction module, used to construct a pipeline based on the branch database and bind the target branch to the branch database; A binding module, used to obtain an idle branch server and bind the idle branch server to a target branch; The initialization module is used to call the target branch to initialize the pipeline and generate deployment completion information.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Code testing method and device
CN109960643A
Database deployment method and device based on assembly line platform and computer equipment
CN114238266A
Task flow processing method, system and equipment based on JIRA system, medium and computer program product
CN115185570A
Code branch environment deployment method and device and electronic equipment
CN116360800A
Integrating database deployment with code deployment
US20110093513A1
