A startup method, device, computer equipment and storage medium
By triggering pre-build functions in WebIDE, obtaining and executing initialization task code, and generating target construction products for building WebIDE container operation dependencies, it solves the problem of low efficiency in manual creation of operation dependencies in WebIDE and improves development efficiency.
Patent Information
- Application Number
- CN202111365216.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2041-11-17
AI Technical Summary
When using WebIDE for subdevelopment tasks, it is necessary to manually allocate containers and create operation dependencies, resulting in inefficient development.
By responding that the currently modified code branch meets the target conditions, the pre-build function is triggered, and the initialization task code is obtained in the repository code of the target development project used to build the WebIDE operation dependency, and the code is executed offline to generate the target construction product for generating the operation dependency required for the container operation.
It improves the flexibility and timeliness of generating target construction products, reduces the steps of users to manually create operation dependencies, and improves the efficiency and development efficiency of WebIDE container initialization.
Smart Images

Figure CN114089973B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of code development, and more particularly, to a startup method, apparatus, computer device, and storage medium. Background Art
[0002] WebIDE is an online integrated development environment for programmers, which has the excellent feature that programmers do not need to install the development environment locally and can start developing immediately just by opening a browser. Usually, a target development project is often split into multiple sub-development tasks and developed by different users.
[0003] However, when users use WebIDE to develop sub-development tasks, after a container is allocated for the sub-development task on the server side, they need to manually create the running dependencies corresponding to the container in WebIDE, which greatly reduces the development efficiency. Summary of the Invention
[0004] Embodiments of the present disclosure provide at least a startup method, apparatus, computer device, and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a startup method, including:
[0006] Responding to the current modified code branch meeting a target condition, triggering a pre-build function; the current modified code branch is the code branch corresponding to the target development project; the target condition means that the code branch affects the initialization process of the container in the online integrated development environment WebIDE;
[0007] Obtaining the first repository code corresponding to the target development project according to a preset code fetching method; and obtaining the initialization task code for building the running dependencies corresponding to WebIDE from the first repository code according to the code version information corresponding to the current modified code branch;
[0008] Executing the initialization task code, obtaining and storing a first target build product; wherein the first target build product is used to generate the running dependencies required for the container to run in WebIDE.
[0009] In a possible implementation manner, after obtaining and storing the first target build product, it further includes:
[0010] Responding to a startup request for any development task in the target development project, determining the code version information to be matched corresponding to the startup request, and starting to execute the target container of the any development task when it is determined that the code version information to be matched and the code version information corresponding to the first target build product match;
[0011] Obtain the stored first target build product and add the first target build product to the working directory corresponding to the target container;
[0012] Generate a WebIDE page corresponding to any one of the development tasks based on the working directory corresponding to the target container.
[0013] In a possible implementation manner, starting the target container for executing any one of the development tasks includes:
[0014] Obtain the first repository code corresponding to the target development project;
[0015] Based on the first repository code, determine a first execution task in the startup task corresponding to the target development project; the first execution task is the default execution task;
[0016] During the process of starting the target container, execute the first execution task to determine the port information corresponding to the target container.
[0017] In a possible implementation manner, generating a WebIDE page corresponding to any one of the development tasks based on the working directory corresponding to the target container includes:
[0018] Based on the first repository code, determine at least one second execution task in the startup task corresponding to the target development project; the second execution task is the selected execution task;
[0019] Generate a first task plugin corresponding to each of the second execution tasks;
[0020] Generate a WebIDE page corresponding to any one of the development tasks based on each of the first task plugins and the working directory corresponding to the target container, where the WebIDE page includes controls corresponding to each of the first task plugins respectively.
[0021] In a possible implementation manner, storing the first target build product includes:
[0022] Store the first target build product in a target storage location for data persistent storage.
[0023] In a possible implementation manner, storing the first target build product includes:
[0024] Generate notification information for indicating that the first target build product is generated and send the notification information to the WebIDE scheduler corresponding to the target development project;
[0025] Use the WebIDE scheduler to store the first target build product in the working directory corresponding to each project node of the target development project, where one project node corresponds to at least one container;
[0026] The obtaining the stored first target build product includes:
[0027] Determine the target project node corresponding to the target container, and obtain the first target build product from the working directory corresponding to the target project node.
[0028] In a possible implementation manner, after obtaining the first target build product, it further includes:
[0029] Obtain the container association record corresponding to each generated build product stored; the container association record is used to record the number of containers matching the corresponding generated build product;
[0030] In the working directory corresponding to each project node of the target development project, delete the generated build products whose container quantity is less than or equal to the preset quantity.
[0031] In a possible implementation manner, the method further includes:
[0032] When it is determined that any one of the development tasks is completed, delete the target container and update the container quantity corresponding to the first target build product.
[0033] In a possible implementation manner, the currently modified code branch includes the main code branch corresponding to the target development project and each sub-code branch having an update association relationship with the main code branch; the update association relationship is used to represent that when the sub-code branch is updated, the main code branch will be synchronously updated.
[0034] In a possible implementation manner, the method further includes:
[0035] When it is determined that the code version information to be matched and the code version information corresponding to the first target build product do not match, obtain the second repository code corresponding to the code version information to be matched;
[0036] In the target container, execute the initialization task code in the second repository code, determine the second target build product, and add the second target build product to the working directory corresponding to the target container;
[0037] Based on the second repository code, determine at least one second execution task corresponding to the code version information to be matched, and generate a second task plugin corresponding to each of the second execution tasks; the second execution task is the selected execution task.
[0038] Based on each of the second task plugins and the working directory corresponding to the target container, generate a WebIDE page corresponding to any one of the development tasks.
[0039] In a second aspect, an embodiment of the present disclosure further provides a startup device, including:
[0040] A trigger module, configured to trigger a pre-build function in response to the current modified code branch satisfying a target condition; the current modified code branch is the code branch corresponding to the target development project; the target condition means that the code branch affects the initialization process of the container in the online integrated development environment WebIDE.
[0041] An acquisition module, configured to acquire the first repository code corresponding to the target development project according to a preset code pulling method; and acquire, from the first repository code, initialization task code for building the runtime dependencies corresponding to the WebIDE according to the code version information corresponding to the current modified code branch.
[0042] An execution module, configured to execute the initialization task code to obtain and store a first target build product; wherein the first target build product is used to generate the runtime dependencies required for the container to run in the WebIDE.
[0043] In a possible implementation manner, the device further includes:
[0044] A startup module, configured to, after obtaining and storing the first target build product, in response to a startup request for any one of the development tasks in the target development project, determine the code version information to be matched corresponding to the startup request, and start and execute the target container of any one of the development tasks when it is determined that the code version information to be matched matches the code version information corresponding to the first target build product.
[0045] Acquire the stored first target build product, and add the first target build product to the working directory corresponding to the target container.
[0046] Based on the working directory corresponding to the target container, generate a WebIDE page corresponding to any one of the development tasks.
[0047] In a possible implementation manner, the startup module is configured to acquire the first repository code corresponding to the target development project.
[0048] Based on the first repository code, determine a first execution task in the startup task corresponding to the target development project; the first execution task is the default execution task;
[0049] During the process of starting the target container, execute the first execution task to determine the port information corresponding to the target container.
[0050] In a possible implementation manner, the startup module is used to determine at least one second execution task in the startup task corresponding to the target development project based on the first repository code; the second execution task is the selected execution task;
[0051] Generate a first task plugin corresponding to each second execution task;
[0052] Based on each first task plugin and the working directory corresponding to the target container, generate a WebIDE page corresponding to any development task, where the WebIDE page includes controls respectively corresponding to each first task plugin.
[0053] In a possible implementation manner, the execution module is used to store the first target build product at a target storage location for data persistent storage.
[0054] In a possible implementation manner, the execution module is used to generate a notification message indicating that the first target build product is generated, and send the notification message to the WebIDE scheduler corresponding to the target development project;
[0055] Use the WebIDE scheduler to store the first target build product in the working directory corresponding to each project node of the target development project, where one project node corresponds to at least one container;
[0056] The startup module is used to determine the target project node corresponding to the target container, and obtain the first target build product from the working directory corresponding to the target project node.
[0057] In a possible implementation manner, the execution module is further used to, after obtaining the first target build product, obtain the container association record corresponding to each stored generated build product; the container association record is used to record the number of containers matching the corresponding generated build product;
[0058] In the working directory corresponding to each project node of the target development project, delete the generated build products whose container quantity is less than or equal to a preset quantity.
[0059] In a possible implementation manner, the device further includes:
[0060] A deletion module, configured to delete the target container and update the number of containers corresponding to the first target build product when it is determined that any one of the development tasks has been completed.
[0061] In a possible implementation, the currently modified code branch includes the main code branch corresponding to the target development project and each sub-code branch having an update association relationship with the main code branch; the update association relationship is used to indicate that when the sub-code branch is updated, the main code branch will be synchronously updated.
[0062] In a possible implementation, the startup module is further configured to obtain the second repository code corresponding to the code version information to be matched when it is determined that the code version information to be matched does not match the code version information corresponding to the first target build product.
[0063] In the target container, execute the initialization task code in the second repository code, determine the second target build product, and add the second target build product to the working directory corresponding to the target container.
[0064] Based on the second repository code, determine at least one second execution task corresponding to the code version information to be matched, and generate a second task plugin corresponding to each second execution task; the second execution task is a selected execution task.
[0065] Based on each second task plugin and the working directory corresponding to the target container, generate a WebIDE page corresponding to any one of the development tasks.
[0066] In a third aspect, an optional implementation of the present disclosure further provides a computer device, including a processor and a memory. The memory stores machine-readable instructions executable by the processor. The processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions execute the steps in the first aspect or any one of the possible implementation manners in the first aspect.
[0067] In a fourth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run, it executes the steps in the first aspect or any one of the possible implementation manners in the first aspect.
[0068] For the effect description of the above-mentioned startup device, computer device, and computer-readable storage medium, refer to the description of the above-mentioned startup method, which will not be elaborated here.
[0069] The startup method, device, computer device, and storage medium provided by the embodiments of the present disclosure, when determining that the currently modified code branch meets the target conditions, utilize the triggered pre-construction function to obtain the initialization task code in the first repository code for building the runtime dependencies corresponding to the WebIDE, and complete the execution of the initialization task code in an offline state, so as to be able to obtain, in an offline state, the first target build product for generating the runtime dependencies required for container operation in the WebIDE; compared with the prior art where the initialization task code needs to be executed when starting the WebIDE container, based on the pre-construction function, the flexibility and timeliness of generating the first target build product are improved. By storing the first target storage product, when subsequently creating runtime dependencies for newly created containers, directly obtain the stored first target storage product and generate runtime dependencies, without the need for users to create runtime dependencies manually, improving the speed of creating runtime dependencies corresponding to the WebIDE container and the efficiency of container initialization, and thus improving the development efficiency.
[0070] Further, for the startup method, device, computer device, and storage medium provided by the embodiments of the present disclosure, each first task plugin is related to the second execution task in the startup task corresponding to the first repository code. By adding controls corresponding to each first task plugin respectively to the WebIDE page corresponding to any generated development task, users only need to select the corresponding controls to load the task plugins corresponding to the controls, that is, to execute the second execution tasks corresponding to the controls, improving the flexibility and convenience of executing the second execution tasks.
[0071] Further, for the startup method, device, computer device, and storage medium provided by the embodiments of the present disclosure, after generating the first target build product, it is also possible to obtain the container association records of each generated build product, and delete the generated build products whose container quantity corresponding to the container association records is less than or equal to the preset quantity in the working directories corresponding to each project node of the target development project, realizing the release of the cache space and avoiding the problem that the cache space is occupied and affects the development speed.
[0072] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings
[0073] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the accompanying drawings required for the embodiments will be briefly introduced below. The accompanying drawings herein are incorporated into the specification and form a part of this specification. These accompanying drawings show embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following accompanying drawings only show some embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related accompanying drawings can be obtained based on these accompanying drawings without creative efforts.
[0074] Figure 1 The flowchart of a startup method provided by an embodiment of the present disclosure is shown;
[0075] Figure 2 The interactive schematic diagram of generating a first target build product using a pre-built function provided by an embodiment of the present disclosure is shown;
[0076] Figure 3 The schematic diagram of a startup device provided by an embodiment of the present disclosure is shown;
[0077] Figure 4 The schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. Detailed implementation manners
[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some, rather than all, of the embodiments of the present disclosure. The components of the embodiments of the present disclosure described and illustrated herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.
[0079] In addition, the terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that shown or described here.
[0080] As used herein, "a plurality of" or "several" means two or more. "And / or" describes the relationship between associated objects and indicates that there can be three relationships. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates an "or" relationship between the associated objects before and after.
[0081] After research, it is found that when users develop sub-development tasks using WebIDE, after allocating a container for the sub-development task on the server side, they need to manually create the runtime dependencies corresponding to the container in WebIDE, which greatly reduces the development efficiency. Moreover, each sub-development task is often split from the main development task corresponding to the target development project. Therefore, when each sub-development task is executed in a container, an initialization command related to the main development task often needs to be repeatedly executed, further causing a waste of development resources.
[0082] In summary, when developing a target development project using the existing technology, not only is the development efficiency low, but there is also a problem of waste of development resources.
[0083] Based on the above research, the present disclosure provides a startup method, device, computer device, and storage medium. When it is determined that the currently modified code branch meets the target conditions, the pre-construction function is triggered to obtain the initialization task code in the first repository code for constructing the runtime dependencies corresponding to WebIDE, and the execution of the initialization task code is completed in an offline state, so that in the offline state, the first target build product for generating the runtime dependencies required for running the container in WebIDE can be obtained; compared with the prior art where the initialization task code needs to be executed only when starting the WebIDE container, based on the pre-construction function, the flexibility and timeliness of generating the first target build product are improved. By storing the first target storage product, when creating runtime dependencies for newly created containers subsequently, the stored first target storage product is directly obtained and runtime dependencies are generated, without the need for users to create runtime dependencies manually, which improves the speed of creating the runtime dependencies corresponding to the WebIDE container and the efficiency of container initialization, thereby improving the development efficiency.
[0084] Moreover, by using the WebIDE scheduler to store the first target build product in the working directory corresponding to each project node of the target development project, it can be ensured that for any newly created container at a project node, the first target build product can be directly obtained at that project node, thereby generating runtime dependencies, ensuring the usability of the first target build product, and avoiding the problem that the newly created container cannot apply the generated first target build product; each newly created container can directly use the first target build product without repeatedly executing the steps of generating the first target build product, effectively avoiding waste of development resources.
[0085] Regarding the defects existing in the above solutions, they are all the results obtained by the inventors through practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by the present disclosure in the following text for the above problems should both be the contributions made by the inventors to the present disclosure during the process of the present disclosure.
[0086] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0087] It should be noted that the specific terms mentioned in the embodiments of the present disclosure include:
[0088] WebIDE: An online integrated development environment for programming developers, which has the excellent feature that programmers do not need to install the development environment locally and can start developing immediately just by opening a browser.
[0089] Git: An open-source distributed version control system that can effectively and efficiently handle version management of projects ranging from very small to very large.
[0090] Monorepo: A way to manage the code of large front-end projects, which means managing multiple modules / packages in one project repository (repo), different from the common way of creating a repo for each module.
[0091] Pod: It can consist of one or more containers. Multiple container applications belonging to the same Pod can communicate with each other only through the local host localhost when accessing each other.
[0092] To facilitate the understanding of this embodiment, first, a startup method disclosed in the embodiments of the present disclosure will be introduced in detail. The execution subject of the startup method provided by the embodiments of the present disclosure is generally a computer device with a certain computing ability. In some possible implementation manners, this startup method can be implemented by a processor invoking computer-readable instructions stored in a memory.
[0093] The following takes the execution entity as the server side as an example to illustrate the startup method provided by the embodiments of the present disclosure.
[0094] As Figure 1 shown, it is a flowchart of a startup method provided by the embodiments of the present disclosure, which may include the following steps:
[0095] S101: When the currently modified code branch meets the target condition, trigger the pre-construction function; the currently modified code branch is the code branch corresponding to the target development project; the target condition means that the code branch has an impact on the initialization process of the container in the online integrated development environment WebIDE.
[0096] Here, the target development project is a pre-determined development project for developing, such as a target program or a target integration function. Generally, the target development project can be a development project that requires multi-user collaboration.
[0097] The target development project may include multiple code branches, each code branch may correspond to a different function, and each code branch may be a code branch split from the main code branch corresponding to the target development project. In specific implementation, the number of code branches corresponding to each target development project can be adaptively modified by the user according to the actual development situation. During the development of the target development project, new code branches can be created at any time.
[0098] The target condition means that the code branch has an impact on the initialization process of the container in WebIDE. Specifically, the initialization process may include loading the repository code corresponding to the code branch and creating the runtime dependencies corresponding to the container. Among them, the repository code may be the overall code corresponding to the target development project, developed by the user and stored in the target repository, specifically, it can be stored in a git repository. The runtime dependency is the execution environment required for the container to run.
[0099] The code branch has an impact on the initialization process of the container in the online integrated development environment WebIDE. Specifically, it may be that the code branch has an impact on the initialization process of the newly created container in WebIDE. Here, since the containers already created in WebIDE have completed initialization and the corresponding runtime dependencies will be fixed before the already created containers are deleted, the currently modified code branch will not have an impact on the initialization process of the already created containers, but only on the initialization process of the newly created containers.
[0100] The containers in the WebIDE are used to execute the development tasks corresponding to different code branches. Different code branches can correspond to different containers. A target development project can correspond to multiple WebIDE containers, and each container is separated from the others. Each container corresponding to the target development project can run in the intranet corresponding to the user, and the repository code corresponding to the target development project can also be mounted in the git repository corresponding to the intranet.
[0101] The pre - build function is a function preset for creating a target build product in the WebIDE in an offline state. Specifically, the pre - build function can create a container in the WebIDE in an offline state, and execute the initialization task code in the repository code corresponding to the target development project obtained by the container to obtain the target build product. Here, different code branches can correspond to different WebIDE branches, and the created container corresponds to the currently modified code branch. That is, the pre - build service is executed on the WebIDE branch corresponding to the currently modified code branch that meets the target conditions. And the reason for creating a container is that the step of executing the initialization task code is performed in an offline state, and the already created container corresponding to the currently modified code branch cannot be used, so a new container needs to be created to execute the initialization task code, but the WebIDE branches corresponding to the two containers are the same.
[0102] Among them, the target build product is used to generate running dependencies for the new container created for the code branch corresponding to the target development project in the WebIDE. The initialization task is a task customized by the user according to a pre - provided configuration file for container initialization. The configuration file can be mounted in the directory of the repository code corresponding to the target development project.
[0103] The operation of modifying a code branch is an operation of modifying the sub - code corresponding to the code branch in the repository code. The operation of modifying a code branch can be specifically performed, for example, on the local server, in a Monorepo environment, on the client and server corresponding to the Monorepo repository, etc., or it can also be performed in the WebIDE, which is not limited here.
[0104] In specific implementation, when it is determined that the pre - build service corresponding to the target development project is enabled, if any currently modified code branch of the determined user meets the target conditions, that is, the currently modified code branch affects the initialization process of the newly created container in the online integrated development environment WebIDE, the pre - build function is triggered for subsequent generation of the target build product.
[0105] S102: Obtain the first repository code corresponding to the target development project according to the preset code pulling method; and obtain the initialization task code for constructing the running dependencies corresponding to the WebIDE from the first repository code according to the code version information corresponding to the currently modified code branch.
[0106] Here, the first repository code is the repository code corresponding to the target development project, which is all the code related to the target development project pre-developed by the user and stored in the git repository. The preset code pulling method can be any method capable of pulling code from the git repository, which is a preset code pulling method matching the pre-construction function.
[0107] The code version information is used to represent the code version corresponding to the currently modified code branch. For example, version 1.0, version 2.0, and so on.
[0108] The initialization task code is the code corresponding to the initialization task defined by the user based on the configuration file for constructing the running dependencies corresponding to the WebIDE. The configuration file can be mounted in the directory corresponding to the repository code, so the initialization task code is also mounted in the directory corresponding to the repository code.
[0109] The first repository code stores the initialization task codes corresponding to different version information. The initialization tasks corresponding to each initialization task code are the same, and their purposes are all to construct the running dependencies corresponding to the WebIDE. The running dependencies corresponding to the WebIDE are also the running dependencies of the containers in the WebIDE corresponding to the new code branch.
[0110] In the specific implementation of this step, after triggering the pre-construction function, the first repository code corresponding to the target development project can be obtained from the git repository mounted on the intranet according to the preset code pulling method. Then, the code version information corresponding to the currently modified code branch can be determined. Specifically, the code version information can be represented by the commit id.
[0111] According to the commit id corresponding to the currently modified code branch, obtain the configuration file corresponding to the currently modified code branch from the first repository code, and then determine the initialization task code for constructing the running dependencies corresponding to the containers in the WebIDE based on the configuration file, that is, obtain the initialization task in the configuration file.
[0112] S103: Execute the initialization task code to obtain and store the first target build product; where the first target build product is used to generate the running dependencies required for the containers in the WebIDE to run.
[0113] Here, after obtaining the initialization task, a container can be created in the WebIDE in an offline state, and the created container can be used to execute the initialization task to obtain a first target build product corresponding to the initialization task.
[0114] Moreover, the first target build product can be stored for use in constructing the runtime dependencies of a newly created container corresponding to a new code branch when starting the WebIDE for the development of the new code branch at a later time.
[0115] In addition, after storing the newly obtained first target build product, the container used by the user to execute the initialization task can be deleted to release the container resources.
[0116] In this way, when it is determined that the currently modified code branch meets the target conditions, the pre-build function is triggered to obtain the initialization task code in the first repository code for constructing the runtime dependencies corresponding to the WebIDE, and the execution of the initialization task code is completed in an offline state, so that the first target build product for generating the runtime dependencies required for the container operation in the WebIDE can be obtained in an offline state; compared with the prior art where the initialization task code can only be executed after starting the WebIDE container, the flexibility and timeliness of generating the first target build product are improved based on the pre-build function. By storing the first target storage product, when creating the runtime dependencies for the newly created container later, the stored first target storage product can be directly obtained and the runtime dependencies can be generated, without the need for the user to create the runtime dependencies manually, which improves the speed of creating the runtime dependencies corresponding to the WebIDE container and the efficiency of container initialization, and thus improves the development efficiency.
[0117] In one embodiment, the currently modified code branch includes the main code branch corresponding to the target development project and each sub-code branch having an update association relationship with the main code branch; the update association relationship is used to represent that the main code branch will be synchronously updated when the sub-code branch is updated.
[0118] Here, as can be seen from the above embodiment, the target development project may include the main code branch and multiple code branches split from the main code branch. The code branches that affect the initialization process of the container in the WebIDE may include the main code branch and each sub-code branch having an update association relationship with the main code branch.
[0119] Here, when changes occur in the main code branch, the corresponding running dependencies will also change. Since each code branch is split from the main code branch, changes in the main code branch will affect each code branch. Therefore, when the main code branch changes, for each corresponding code branch, the running dependencies corresponding to each code branch will also change. So, the currently modified code branch can include the main branch.
[0120] For each sub-code branch that has an update association relationship with the main code branch, when an update occurs in this sub-code branch, it will affect the main code branch to be updated. Furthermore, the update of the main code branch will affect the running dependencies of each corresponding sub-code branch. Therefore, the currently modified code branch can also include each sub-code branch that has an update association relationship with the main code branch.
[0121] In specific implementation, the target conditions can be set by using the central management platform corresponding to the WebIDE. Alternatively, in one implementation manner, matching rules can be set in the central management platform, and the matching rules are used to trigger the pre-build function. Specifically, the matching rules can be: when it is determined by using the central management platform that the currently modified code branch is the main code branch or each sub-code branch that has an update association relationship with the main code branch, the pre-build function is triggered; otherwise, it is not triggered.
[0122] In one embodiment, for the step of storing the first target build product, the obtained first target build product can be stored at a target storage location for data persistent storage. Specifically, central cache persistent management can be performed on the first target build product and it can be stored at a target storage location such as a local disk, a remote database, etc.
[0123] In one embodiment, for the step of storing the first target build product, after the first target build product is generated, notification information for indicating that the first target build product has been generated can also be generated. Among them, the notification information can include the first target build product, or include the location corresponding to the first target build product.
[0124] After that, the notification information can be sent to the WebIDE scheduler corresponding to the WebIDE. The WebIDE scheduler is used to schedule and transfer information corresponding to each WebIDE container related to the target development project.
[0125] A target development project can correspond to multiple development tasks. Different development tasks correspond to different code branches, and different code branches correspond to different project nodes. The number of project nodes corresponding to a target development project is fixed. Containers corresponding to each code branch related to the target development project can be deployed in the project nodes corresponding to the target development project. One project node corresponds to one pod, and one pod can correspond to at least one container.
[0126] After sending the notification information to the WebIDE scheduler, when the notification information includes the first target build product, the WebIDE scheduler can be used to store the first target build product in the working directory corresponding to each project node of the target development project. After storing the first target build product in the working directory corresponding to the project node, each container under the project node can work according to the working directory during runtime.
[0127] In this way, after storing the first target build product in the working directory corresponding to the project node, it can not only ensure that newly created containers in any project node can directly obtain the first target build product in that project node, thereby generating runtime dependencies and ensuring the usability of the first target build product. Moreover, since the created containers and / or newly created containers corresponding to each project node are all related to the target development project, storing the first target build product under each project node corresponding to the target development project can achieve the sharing of the first target build product.
[0128] When the notification information includes the location corresponding to the first target build product, the first target build product can be obtained from that location first, and then the WebIDE scheduler can be used to store the first target build product in the working directory corresponding to each project node of the target development project.
[0129] In addition, in specific implementation, it is also possible to not only perform centralized cache persistence management on the first target build product but also use the WebIDE scheduler to store the first target build product in the working directory corresponding to each project node.
[0130] As Figure 2 shown, it is an interaction schematic diagram of generating the first target build product using the pre-build function provided by an embodiment of the present disclosure. Among them, the central management platform is used to set matching rules, and when the central management platform determines that the code branch currently modified by the user is the main code branch or each sub-code branch having an update association relationship with the main code branch, it triggers the pre-build function. In addition, the central management platform can also be used to obtain git repository permissions and obtain the first repository code using the git repository permissions (which will be introduced later).
[0131] The pre - build function is used to generate a first target build product based on the first repository code, and then generate and send a notification message to the WebIDE scheduler, so that the WebIDE scheduler stores the first target build product in the working directory corresponding to each project node. The pre - build function is also used to store the first target build product in a target storage location (for central cache persistence management) after it is generated.
[0132] Moreover, each container corresponding to a project node can also directly pull the target build product (including the first target build product) at the target storage location to create the running dependencies corresponding to the container.
[0133] In one embodiment, after storing the first target build product, the first target build product can also be applied. Specifically, it may include the following steps:
[0134] Step 1: In response to a start request for any development task in the target development project, determine the code version information to be matched corresponding to the start request. And when it is determined that the code version information to be matched and the code version information corresponding to the first target build product match, start the target container for executing any development task.
[0135] Here, any development task corresponds to a code branch of the target development project, and this code branch can be a newly split code branch from the main code branch corresponding to the target development project. The start request is a request for the user to start the WebIDE for any development task in the target development project. Specifically, the start request is the request for the user to initiate the first start of the WebIDE branch corresponding to any development task. Based on the start request, the WebIDE can create a new target container for this start request.
[0136] The code version information to be matched is the code version information corresponding to the development task, and different development tasks have different code version information. Specifically, the code version information to be matched can be the commit id corresponding to the development task.
[0137] Specifically in implementation, the server can respond to the start request for any development task in the target development project initiated by the user, determine the commit id corresponding to this start request based on the development task corresponding to this start request, and then match the commit id corresponding to this start request with the code version information (commit id) corresponding to the first target build product. When it is determined that the two commit ids are the same, start the target container for executing any development task.
[0138] It should be noted that in the specific implementation, there is no strict execution order between the step of starting the target container for executing any development task and the step of matching the commit id. For example, it is also possible to first start the target container for executing any development task and then perform the commit id matching.
[0139] In addition, in the case where it is determined that the code version information to be matched is the same as the code version information corresponding to the first target build product, a branch switching operation needs to be performed to switch the branch corresponding to the WebIDE from the branch corresponding to the first target build product to the code branch corresponding to the startup request. In this way, through the branch switching operation, it can be ensured that the user is on the correct branch after using the WebIDE, that is, the branch corresponding to the startup request.
[0140] Step 2: Obtain the stored first target build product and add the first target build product to the working directory corresponding to the target container.
[0141] Here, in the case where it is determined that the code version information to be matched is the same as the code version information corresponding to the first target build product, the stored first target build product can be obtained. Specifically, the first target build product can be obtained from the target storage location corresponding to the first target build product. For example, the first target build product can be obtained from locations such as a local disk or a remote database, or from the working directory of the project node corresponding to the target container.
[0142] In addition, for the step of matching the commit id corresponding to the startup request, the commit id corresponding to the startup request can be respectively matched with the commit id of each generated build product to determine whether there is a generated build product whose commit id matches the commit id corresponding to the startup request. Here, since the startup request must be initiated after the generation of the first target build product, the generated build products can include the first target build product.
[0143] When Step 2 is executed, the generated build product whose determined commit id matches the commit id corresponding to the startup request can be directly obtained.
[0144] Taking the acquisition of the first target build product as an example, after the first target build product is acquired, it can be added to the working directory corresponding to the target container. Specifically, the command mount-t overlay overlay-olowerdir= / lower,upperdir= / upper,workdir= / work / merged in WebIDE can be used to map the first target build product as read-only layer (lower) information to the working directory (merged) of WebIDE, and map the write information of the user for the first target build product as writable layer (lower) information to the working directory (merged) of WebIDE.
[0145] In addition, when it is determined that the code version information to be matched matches the code version information corresponding to the first target build product, the cache directory of the project node corresponding to the first target build product can also be directly acquired and the entire cache directory can be added to the working directory corresponding to the target container.
[0146] Step 3: Generate a WebIDE page corresponding to any development task based on the working directory corresponding to the target container.
[0147] In specific implementation, since the working directory includes the first target build product, running according to the working directory corresponding to the target container can generate the running dependencies corresponding to the target container, and running according to other target information in the working directory corresponding to the target container can obtain all the information required by the target container, such as code information, page height information, page style information, etc. Furthermore, based on all the information required by the target container and the running dependencies, a WebIDE page can be generated. Among them, the WebIDE page is the development page corresponding to the target container.
[0148] In one embodiment, for the step of starting and executing the target container for any development task in Step 1, it can be implemented according to the following steps:
[0149] ①: Acquire the first repository code of the target development project.
[0150] In specific implementation, the central management platform can be used to acquire the git permissions pre-authorized by the user. Furthermore, the first repository code of the target development project corresponding to any development task can be acquired from the git repository using the git permissions.
[0151] ②: Based on the first repository code, determine the first execution task in the start task corresponding to the target development project; the first execution task is the default execution task.
[0152] Here, as can be seen from the above embodiments, the first repository code may include a predefined configuration file. In specific implementation, the configuration file may include, in addition to the initialization task code mentioned in the above embodiments, startup task code corresponding to user-defined startup tasks. The startup task is a task corresponding to a target development project, and can be used to allocate port information for a container corresponding to the target development project, and can also be used to generate a WebIDE page corresponding to the container.
[0153] The startup task may include a first execution task and a second execution task. The second execution task is the default execution task, and the second execution task is the selected execution task. Specifically, it can be a task that the user can choose to execute.
[0154] In specific implementation of this step, after obtaining the first repository code, the configuration file can be obtained from the first repository code, and then based on the configuration file, the user-defined startup task can be determined. The first execution task code corresponding to the target development project is obtained from the startup task, that is, the first execution task is obtained.
[0155] ③: During the process of starting the target container, execute the first execution task to determine the port information corresponding to the target container.
[0156] In specific implementation, after determining the first execution task corresponding to the target development project, during the process of starting the target container, the first execution task can be executed, so as to obtain the port information corresponding to the target container. That is, the default execution task in the startup task can be executed when starting the container.
[0157] In one embodiment, for the above step three, first, at least one second execution task in the startup task corresponding to the target development project can be determined based on the first repository code; the second execution task is the selected execution task.
[0158] In specific implementation, the user-defined startup task can be determined from the configuration file corresponding to the first repository code, and then the second execution task code corresponding to the target development project can be obtained from the startup task, so as to obtain the second execution task.
[0159] Then, for each obtained second execution task, a first task plugin corresponding to each second execution task can be generated.
[0160] Furthermore, based on each first task plugin and the working directory corresponding to the target container, a WebIDE page corresponding to any development task can be generated. The WebIDE page includes controls corresponding to each first task plugin respectively.
[0161] Here, the control is used for the user to select the first task plugin on the WebIDE page. For example, the control can support the user to click on the control corresponding to the first task plugin to select the first task plugin. The control corresponding to each first task plugin can be displayed on the WebIDE page in the form of a control panel.
[0162] In a specific implementation, as can be seen from the above embodiments, according to the working directory corresponding to the target container, the running dependencies corresponding to the target container and all the information required by the target container can be generated. For each first task plugin, the control corresponding to each first task plugin can be determined first, and then based on each determined control, the control panel that can be displayed can be determined. After that, based on the control panel, all the information required by the target container and the running dependencies, the WebIDE page can be generated.
[0163] Among them, the control panel can be displayed at any position on the WebIDE page. For example, the upper left corner position, the upper right corner position, etc. When the user clicks on the control in the control panel, the server can execute the second execution task corresponding to the control and feedback the execution result to the client.
[0164] In one embodiment, after obtaining the first target build product by using the pre-build function, the container association record corresponding to each generated build product stored can also be obtained. The container association record is used to record the number of containers matching the corresponding generated build product.
[0165] Here, the generated build products include each target build product obtained by using the pre-build function before generating the first target build product. Each generated build product can be stored on each project node corresponding to the target development project. The number of containers corresponding to the container association record of each generated build product can be determined when matching the commitid corresponding to the start request. Specifically, for each generated build product, when the commit id of the generated build product matches the commit id of the start request initiated by the user, the number of containers in the container association record corresponding to the generated build product can be incremented by 1.
[0166] Then, according to the container association record corresponding to each generated build product, the number of containers corresponding to each generated build product can be determined. After that, from the generated build products, the generated build products corresponding to the number of containers less than or equal to the preset number (such as 0) can be filtered out. Furthermore, the filtered generated build products can be deleted from the working directory corresponding to each project node of the target development project. In this way, the release of the cache space is achieved, and the problem that the cache space is occupied and affects the development speed is avoided.
[0167] Moreover, for the generated build products whose corresponding container numbers are less than or equal to the preset number, they are only deleted in the working directories corresponding to each project node of the target development project, but not deleted at the target storage location. In this way, it can be ensured that if the generated build product is needed subsequently, it can be obtained at the target storage location without regenerating, which is conducive to improving development efficiency.
[0168] In addition, for the newly generated first target build product, its corresponding container number is 0. However, since the first target build product is a newly generated build product, even if the container number corresponding to the first target build product is less than or equal to the preset number, the first target build product will not be deleted this time.
[0169] In one embodiment, when it is determined that any development task corresponding to the target development project has been completed, the container corresponding to the any development task can be deleted, and the container numbers corresponding to each generated target build product (which can include the first target build product) corresponding to the container can be updated.
[0170] Taking the target build product corresponding to any development task as the first target build product as an example, when the any development task is completed, the target container corresponding to the any development task can be deleted. Moreover, after deleting the target container, the container number corresponding to the first target build product can be updated. Specifically, the container number recorded in the container association record corresponding to the first target build product can be decreased by 1.
[0171] In one embodiment, for the above step 1, when it is determined that the code version information to be matched does not match the code version information corresponding to the first target build product, that is, when it is determined that the commit id corresponding to the start request is different from the commit id corresponding to the first target build product, the WebIDE page corresponding to the development task can also be generated according to the following steps:
[0172] P1: When it is determined that the code version information to be matched does not match the code version information corresponding to the first target build product, obtain the second repository code corresponding to the code version information to be matched.
[0173] Here, the second repository code can be a repository code different from the first repository code, the repository code corresponding to the start request written by the user, and a repository code that has not been executed. Specifically, the second repository code is also the repository code corresponding to the target development project. For example, it can be the modified first repository code.
[0174] In the case where it is determined that the commit id corresponding to the startup request is different from the commit id corresponding to the first target build product, and in the case where it is determined that there is no commit id corresponding to any generated build product that is the same as the commit id corresponding to the startup request, it indicates that the target build product corresponding to the startup request has not been generated yet. Therefore, first, based on the code version information to be matched corresponding to the startup request, the central management platform can be used to pull the second repository code corresponding to the code version information to be matched from the git repository.
[0175] P2: In the target container, execute the initialization task code in the second repository code, determine the second target build product, and add the second target build product to the working directory corresponding to the target container.
[0176] During specific implementation, based on the second repository code, the initialization task code corresponding to the second repository code can be determined, and the initialization task code can be executed to obtain the second target build product, and the second target build product can be added to the working directory corresponding to the target container for creating the running dependencies corresponding to the target container.
[0177] Here, the generated second target build product is only added to the working directory corresponding to the target container and will not be added to all project nodes corresponding to the target development project, and is only for use by the target container.
[0178] P3: Based on the second repository code, determine at least one second execution task corresponding to the code version information to be matched, and generate a second task plugin corresponding to each second execution task; the second execution task is the selected execution task.
[0179] Here, based on the second repository code, the startup task corresponding to the second repository code can be determined first, and then, at least one second execution task in the startup task can be determined; afterwards, a second task plugin corresponding to each second execution task can be generated.
[0180] P4: Based on each second task plugin and the working directory corresponding to the target container, generate a WebIDE page corresponding to any development task.
[0181] Here, any development task is the development task corresponding to the startup request.
[0182] During specific implementation, for P4, the steps of generating a WebIDE page corresponding to any development task based on each first task plugin and the working directory corresponding to the target container in the above embodiments can be referred to, and will not be elaborated here.
[0183] Regarding the specific implementation steps of the above P1 - P4, the above embodiments can be referred to, and will not be elaborated here.
[0184] In addition, in the case where the pre - building function is not enabled, after obtaining a start request for any development task in the target development project, the first repository code can be obtained first and the target container can be started. Then, in the target container, the initialization task corresponding to the first repository code is executed first, and then the start task is executed, and finally the WebIDE page corresponding to the development task is obtained. For the specific implementation steps of obtaining the WebIDE page, reference can be made to the above - mentioned embodiments regarding the start request for any development task in the target development project, and details will not be elaborated here.
[0185] Among them, the enabling and disabling of the pre - building function can be controlled by using the central management platform.
[0186] In addition, for any development task, after the container corresponding to the development task is created, if the container is started again using the WebIDE subsequently, the initialization task corresponding to the development task will not be executed again, and only the start task corresponding to the development task will be executed.
[0187] Those skilled in the art can understand that in the above - mentioned method of the specific implementation manner, the writing order of each step does not mean a strict execution order that constitutes any limitation to the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0188] Based on the same inventive concept, an activation device corresponding to the activation method is also provided in the embodiments of the present disclosure. Since the principle of solving problems by the device in the embodiments of the present disclosure is similar to the above - mentioned activation method in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0189] As Figure 3 shown, it is a schematic diagram of an activation device provided by an embodiment of the present disclosure, including:
[0190] A trigger module 301, configured to trigger the pre - building function in response to the currently modified code branch satisfying the target condition; the currently modified code branch is the code branch corresponding to the target development project; the target condition means that the code branch has an impact on the initialization process of the container in the online integrated development environment WebIDE;
[0191] An acquisition module 302, configured to acquire the first repository code corresponding to the target development project according to a preset code pulling method; and acquire the initialization task code for building the running dependencies corresponding to the WebIDE from the first repository code according to the code version information corresponding to the currently modified code branch;
[0192] An execution module 303 is configured to execute the initialization task code, obtain and store a first target build product, where the first target build product is used to generate the runtime dependencies required for container runtime in the WebIDE.
[0193] In a possible implementation, the apparatus further includes:
[0194] A start module 304 is configured to, after obtaining and storing the first target build product, in response to a start request for any development task in the target development project, determine the code version information to be matched corresponding to the start request, and start and execute a target container for the any development task when it is determined that the code version information to be matched and the code version information corresponding to the first target build product match;
[0195] Obtain the stored first target build product, and add the first target build product to the working directory corresponding to the target container;
[0196] Generate a WebIDE page corresponding to the any development task based on the working directory corresponding to the target container.
[0197] In a possible implementation, the start module 304 is configured to obtain the first repository code corresponding to the target development project;
[0198] Based on the first repository code, determine a first execution task in the start task corresponding to the target development project; the first execution task is the default execution task;
[0199] During the process of starting the target container, execute the first execution task to determine the port information corresponding to the target container.
[0200] In a possible implementation, the start module 304 is configured to, based on the first repository code, determine at least one second execution task in the start task corresponding to the target development project; the second execution task is the selected execution task;
[0201] Generate a first task plugin corresponding to each second execution task;
[0202] Generate a WebIDE page corresponding to the any development task based on each first task plugin and the working directory corresponding to the target container, where the WebIDE page includes controls respectively corresponding to each first task plugin.
[0203] In a possible implementation, the execution module 303 is configured to store the first target build product at a target storage location for data persistent storage.
[0204] In a possible implementation, the execution module 303 is configured to generate notification information for characterizing that the generation of the first target build product is completed, and send the notification information to the WebIDE scheduler corresponding to the target development project;
[0205] The WebIDE scheduler is used to store the first target build product in the working directory corresponding to each project node of the target development project, where one project node corresponds to at least one container;
[0206] The start module 304 is configured to determine the target project node corresponding to the target container, and obtain the first target build product from the working directory corresponding to the target project node.
[0207] In a possible implementation, after obtaining the first target build product, the execution module 303 is further configured to obtain the container association record corresponding to each stored generated build product; the container association record is used to record the number of containers matching the corresponding generated build product;
[0208] In the working directory corresponding to each project node of the target development project, delete the generated build products whose container quantity is less than or equal to the preset quantity.
[0209] In a possible implementation, the device further includes:
[0210] The deletion module 305 is configured to delete the target container and update the container quantity corresponding to the first target build product when it is determined that any one of the development tasks is completed.
[0211] In a possible implementation, the currently modified code branch includes the main code branch corresponding to the target development project and each sub-code branch having an update association relationship with the main code branch; the update association relationship is used to characterize that when the sub-code branch is updated, the main code branch will be synchronously updated.
[0212] In a possible implementation, when it is determined that the code version information to be matched does not match the code version information corresponding to the first target build product, the start module 304 is further configured to obtain the second repository code corresponding to the code version information to be matched;
[0213] In the target container, execute the initialization task code in the second repository code, determine the second target build product, and add the second target build product to the working directory corresponding to the target container;
[0214] Based on the second repository code, determine at least one second execution task corresponding to the code version information to be matched, and generate a second task plug-in corresponding to each of the second execution tasks; the second execution task is a selected execution task.
[0215] Based on each of the second task plug-ins and the working directory corresponding to the target container, generate a WebIDE page corresponding to any one of the development tasks.
[0216] Descriptions of the processing flows of the various modules in the device and the interaction flows between the various modules may refer to the relevant descriptions in the foregoing method embodiments, and will not be elaborated here.
[0217] Embodiments of the present disclosure further provide a computer device, as Figure 4 shown, which is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure, including:
[0218] a processor 41 and a memory 42; the memory 42 stores machine-readable instructions executable by the processor 41, and the processor 41 is configured to execute the machine-readable instructions stored in the memory 42. When the machine-readable instructions are executed by the processor 41, the processor 41 executes the following steps: S101: When the currently modified code branch meets the target condition, trigger the pre-build function; the currently modified code branch is the code branch corresponding to the target development project; the target condition means that the code branch affects the initialization process of the container in the online integrated development environment WebIDE; S102: According to a preset code pulling method, obtain the first repository code corresponding to the target development project; and according to the code version information corresponding to the currently modified code branch, obtain from the first repository code the initialization task code for building the running dependencies corresponding to the WebIDE and S103: Execute the initialization task code to obtain and store a first target build product; wherein, the first target build product is used to generate the running dependencies required for the container to run in the WebIDE.
[0219] The foregoing memory 42 includes a memory 421 and an external memory 422; the memory 421 here is also called an internal memory, which is used to temporarily store the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk, and the processor 41 exchanges data with the external memory 422 through the memory 421.
[0220] The specific execution process of the foregoing instructions may refer to the steps of the startup method described in the embodiments of the present disclosure, and will not be elaborated here.
[0221] Embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the startup method described in the foregoing method embodiments. Among them, the storage medium may be a volatile or non-volatile computer-readable storage medium.
[0222] A computer program product of the startup method provided by embodiments of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the startup method described in the foregoing method embodiments. For details, refer to the foregoing method embodiments and will not be elaborated here.
[0223] This computer program product can be specifically implemented in a manner of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0224] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here. In several embodiments provided by the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined, or some features can be ignored, or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical, or other form.
[0225] The unit described as a separated component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0226] In addition, each functional unit in various embodiments of the present disclosure can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0227] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0228] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of the present disclosure, used to illustrate the technical solutions of the present disclosure, rather than limiting them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A startup method, characterized in that: include: In response to the currently modified code branch meeting the target condition, triggering the pre-build function; the currently modified code branch is the code branch corresponding to the target development project; The target condition refers to the influence of the code branch on the initialization process of the container in the online integrated development environment WebIDE; Obtaining the first warehouse code corresponding to the target development project according to a preset code pulling method; and obtaining the initialization task code for building the running dependency corresponding to the WebIDE from the first warehouse code according to the code version information corresponding to the currently modified code branch; Execute the initialization task code to obtain and store a first target build product; wherein the first target build product is used to generate the running dependency required for the container running in the WebIDE; In response to a start request for any development task in the target development project, when it is determined that the to-be-matched code version information corresponding to the start request matches the code version information corresponding to the first target build product, based on a first warehouse code corresponding to the target development project, determine a first execution task in the start task corresponding to the target development project, and in the process of starting a target container, execute the first execution task to determine the port information corresponding to the target container; Obtaining the first target build product, and adding the first target build product to the working directory corresponding to the target container; Based on the working directory corresponding to the target container, a WebIDE page corresponding to any development task is generated.
2. The method according to claim 1, characterized in that The generating a WebIDE page corresponding to any development task based on the working directory corresponding to the target container includes: Based on the first warehouse code, determining at least one second execution task among the startup tasks corresponding to the target development project; the second execution task is the selected execution task; Generate a first task plug-in corresponding to each of the second execution tasks; Based on each of the first task plug-ins and the working directory corresponding to the target container, a WebIDE page corresponding to any one of the development tasks is generated, wherein the WebIDE page includes controls corresponding to each of the first task plug-ins.
3. The method according to claim 1, characterized in that The storing of the first target construction product includes: The first target build product is stored in a target storage location for persistent data storage.
4. The method according to claim 1, characterized in that: The storing of the first target construction product includes: Generate notification information for indicating that generation of the first target build product is complete, and send the notification information to a WebIDE scheduler corresponding to the target development project; Using the WebIDE scheduler, storing the first target build product in a working directory corresponding to each project node of the target development project, wherein one project node corresponds to at least one container; The acquiring the stored first target construction product includes: A target project node corresponding to the target container is determined, and the first target build product is obtained from a working directory corresponding to the target project node.
5. The method according to claim 4, characterized in that After obtaining the first target construction product, the method further includes: Obtaining a stored container association record corresponding to each generated build product; the container association record is used to record the number of containers matching the corresponding generated build product; In the working directory corresponding to each project node of the target development project, the generated build products whose container quantity is less than or equal to the preset quantity are deleted.
6. The method according to claim 5, characterized in that The method further comprises: When it is determined that any one of the development tasks is completed, the target container is deleted, and the number of containers corresponding to the first target build product is updated.
7. The method according to claim 1, characterized in that The currently modified code branch includes a main code branch corresponding to the target development project and each sub-code branch that has an update association relationship with the main code branch; The update association relationship is used to indicate that when the sub-code branch is updated, the main code branch will be updated synchronously.
8. The method according to claim 1, characterized in that The method further comprises: When it is determined that the to-be-matched code version information and the code version information corresponding to the first target build product do not match, obtaining a second warehouse code corresponding to the to-be-matched code version information; In the target container, executing the initialization task code in the second warehouse code, determining a second target build product, and adding the second target build product to a working directory corresponding to the target container; Based on the second warehouse code, determining at least one second execution task corresponding to the to-be-matched code version information, and generating a second task plug-in corresponding to each second execution task; the second execution task is the selected execution task; Based on each of the second task plug-ins and the working directory corresponding to the target container, a WebIDE page corresponding to any development task is generated.
9. A starting device, characterized in that: include: A trigger module, configured to trigger a pre-build function in response to a currently modified code branch satisfying a target condition; the currently modified code branch is a code branch corresponding to a target development project; The target condition refers to the influence of the code branch on the initialization process of the container in the online integrated development environment WebIDE; An acquisition module is used to acquire the first warehouse code corresponding to the target development project according to a preset code pulling method; and acquire the initialization task code for building the running dependency corresponding to the WebIDE from the first warehouse code according to the code version information corresponding to the currently modified code branch; An execution module, configured to execute the initialization task code, obtain and store a first target build product; wherein the first target build product is used to generate a running dependency required for the container running in the WebIDE; A startup module, for responding to a startup request for any development task in the target development project, and determining, based on a first warehouse code corresponding to the target development project, a first execution task in the startup task corresponding to the target development project when determining that the code version information to be matched corresponding to the startup request matches the code version information corresponding to the first target build product; in the process of starting a target container, executing the first execution task to determine the port information corresponding to the target container; obtaining the first target build product, and adding the first target build product to the working directory corresponding to the target container; and generating a WebIDE page corresponding to any development task based on the working directory corresponding to the target container.
10. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the startup method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a computer device, the computer device executes the steps of the startup method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Container application deployment method and device, computer equipment and storage medium
CN108958927A