Business application updating method and device
By deploying continuous integration servers on both the external and internal networks, and using instruction messages and compilation builds to generate container images, the problem of version inconsistency across data centers was solved, enabling faster updates to business applications.
Patent Information
- Application Number
- CN202211483237.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-11-24
AI Technical Summary
Because the internal network environment cannot directly access the public network, the cross-datacenter container image transfer speed is slow, resulting in inconsistencies in the versions of business applications between internal and external network datacenters.
Continuous integration servers are deployed in both the external network and internal network environments. The external network continuous integration server obtains the target source code and target dependency packages of the new version and sends an instruction message to the internal network continuous integration server. The internal and external network continuous integration servers respectively execute compilation and build to generate container images to realize the version update of business applications.
By reducing data transmission volume and performing separate compilation and build operations, the time when business applications experienced version inconsistencies between internal and external network data centers was shortened.
Smart Images

Figure CN117270900B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of continuous integration technology. More specifically, it relates to a method and apparatus for updating business applications. Background Technology
[0002] Currently, when business applications are deployed in multiple data centers across intranet and extranet environments, the continuous integration server is typically deployed in the extranet data center because the intranet data center lacks access to the public internet. The continuous integration server retrieves newly submitted source code from the project code repository, downloads the corresponding dependency packages from the dependency package repository, and then compiles and builds the container image based on the source code and dependency packages. After executing local automated test cases on the container image, if no issues are found, the container image is pushed to the container image repository in the local (extranet) data center. Finally, it is synchronized to the container image repository in the intranet data center via a network gateway or Virtual Private Network (VPN) tunnel.
[0003] Due to limitations in transmission methods, cross-datacenter image transfer is extremely slow. Taking network gateway channels as an example, the transfer rate is less than 1MB / s, while container images are typically larger than 800MB. It often takes more than 10 minutes to synchronize container images from the external network environment to the internal network environment. During this synchronization window, the same application might deploy a new version in the external datacenter and use the new version, while still using the old version in the internal datacenter, leading to a prolonged version inconsistency between the two environments. Summary of the Invention
[0004] To address or at least partially address the aforementioned technical problems, this application provides a method and apparatus for updating business applications, which can effectively shorten the time when business applications are inconsistent between internal and external network data centers.
[0005] In a first aspect, embodiments of this application provide a business application update method, applied to an external network continuous integration server deployed in an external network environment, comprising:
[0006] Obtain the target source code and target dependency packages for the new version of the business application;
[0007] Send a first message to the intranet continuous integration server deployed in the intranet environment. The first message is used to indicate the target source code and the target dependency package, so that the intranet continuous integration server performs compilation and build based on the target source code and target dependency package indicated by the first message to generate an intranet container image, so as to realize the version update of the business application based on the intranet container image in the intranet environment.
[0008] Based on the target source code and its dependent packages, a compilation and build process is performed to generate an external container image, which is then used to update the version of the business application in the external network environment.
[0009] Secondly, embodiments of this application provide a business application update method, applied to an intranet continuous integration server deployed in an intranet environment, comprising:
[0010] The first message is received from the external network continuous integration server deployed in the external network environment. The first message is used to instruct the external network continuous integration server to obtain the target source code and target dependency package of the new version of the business application. The target source code and target dependency package are used by the external network continuous integration server to compile and build an external network container image, so as to realize the version update of the business application based on the external network container image in the external network environment.
[0011] Based on the target source code and target dependency packages indicated by the first message, the system compiles and builds to generate an intranet container image, so as to implement version updates of the business application in the intranet environment based on the intranet container image.
[0012] Thirdly, embodiments of this application provide a business application update apparatus, including: an acquisition module, a sending module, and a generation module;
[0013] This acquisition module is used to acquire the target source code and target dependency packages of the new version of the business application;
[0014] The sending module is used to send a first message to the intranet continuous integration server deployed in the intranet environment. The first message is used to indicate the target source code and the target dependency package obtained by the acquisition module, so that the intranet continuous integration server can perform compilation and build based on the target source code and the target dependency package indicated by the first message to generate an intranet container image, so as to realize the version update of the business application based on the intranet container image in the intranet environment.
[0015] The generation module is used to compile and build an external container image based on the target source code and target dependency package obtained by the acquisition module, so as to realize the version update of the business application in the external network environment based on the external container image.
[0016] Fourthly, embodiments of this application provide a business application update apparatus, including: a receiving module and a generating module;
[0017] The receiving module is used to receive a first message from an external network continuous integration server deployed in an external network environment. The first message is used to instruct the external network continuous integration server to obtain the target source code and target dependency package of the new version of the business application. The target source code and target dependency package are used by the external network continuous integration server to compile and build an external network container image, so as to realize the version update of the business application based on the external network container image in the external network environment.
[0018] The generation module is used to compile and build an intranet container image based on the target source code and target dependency package indicated by the first message received by the receiving module, so as to realize the version update of the business application in the intranet environment based on the intranet container image.
[0019] Fifthly, embodiments of this application provide an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements the business application update method as shown in the first or second aspect.
[0020] In a sixth aspect, embodiments of this application provide a computer-readable storage medium, including: storing a computer program on the computer-readable storage medium, wherein when the computer program is executed by a processor, it implements the business application update method as shown in the first or second aspect.
[0021] In a seventh aspect, embodiments of this application provide a computer program product, including: when the computer program product is run on a computer, causing the computer to implement the business application update method as shown in the first or second aspect.
[0022] Compared with the prior art, the technical solution provided in this application has the following advantages: In this application embodiment, an external network continuous integration server deployed in an external network environment obtains the target source code and target dependency package of a new version of the business application; the external network continuous integration server sends a first message to an internal network continuous integration server deployed in an internal network environment, the first message indicating the target source code and the target dependency package; the internal network continuous integration server performs compilation and building based on the target source code and the target dependency package indicated by the first message to generate an internal network container image, so as to realize the version update of the business application based on the internal network container image in the internal network environment; the external network continuous integration server performs compilation and building based on the target source code and the target dependency package to generate an external network container image, so as to realize the version update of the business application based on the external network container image in the external network environment. In this solution, integration servers are deployed in both external and internal network environments. The external network continuous integration server accesses the public network to obtain the target source code and target dependency packages for the new version of the business application. It then sends a first message indicating the target source code and dependency packages to the internal network continuous integration server. Based on this first message, the internal network continuous integration server obtains the target source code and dependency packages. Both the internal and external network continuous integration servers can then compile and build container images based on the target source code and dependency packages, respectively. Finally, they update the business application version based on their respective generated container images. The data volume of the first message indicating the target source code and dependency packages is much smaller than the container image size, thus significantly reducing the transmission time. Furthermore, the separate compilation and building of container images by the internal and external network continuous integration servers, and their separate updates of the business application version, effectively shortens the time when the business application version is inconsistent between the internal and external network data centers. Attached Figure Description
[0023] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0024] Figure 1 A scenario architecture diagram of existing business application update methods is shown;
[0025] Figure 2 A scenario architecture diagram of a business application update method according to some embodiments is shown;
[0026] Figure 3 One of the flowcharts for a business application update method according to some embodiments is shown;
[0027] Figure 4 A second schematic flowchart of a business application update method according to some embodiments is shown;
[0028] Figure 5 The third flowchart illustrates a business application update method according to some embodiments;
[0029] Figure 6 The fourth flowchart illustrates a business application update method according to some embodiments;
[0030] Figure 7 The fifth flowchart illustrates a business application update method according to some embodiments;
[0031] Figure 8 A flowchart of a business application update method according to some embodiments is shown as diagram six;
[0032] Figure 9 The seventh flowchart illustrates a business application update method according to some embodiments;
[0033] Figure 10 A schematic diagram illustrating the process of performing business application updates on internal and external networks according to some embodiments is shown;
[0034] Figure 11 A framework diagram of a business application update device according to some embodiments is shown;
[0035] Figure 12 A framework diagram of a business application update device according to some embodiments is shown;
[0036] Figure 13 A schematic diagram of computer device hardware according to some embodiments is shown. Detailed Implementation
[0037] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0038] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0039] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0040] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0041] In the existing technology of container cloud cross-data center / cross-region continuous integration, when business applications are deployed in multiple data centers in intranet and extranet environments, the continuous integration server needs to be deployed in an extranet environment data center because the data center in the intranet environment does not have the conditions to access the public network. Figure 1 Architecture diagrams for deploying business applications in existing technologies, such as Figure 1 As shown, data center A is where business applications are deployed in the external network environment, while data center B is where business applications are deployed in the internal network environment. Data center A has a continuous integration server deployed, while data center B does not. The continuous integration server in data center A retrieves newly submitted code from developers via the public network, downloads dependency packages, and then executes a build task to generate a container image. Based on this container image, local automated test cases are executed. If the verification is successful, the image is pushed to the container image repository in the local data center, completing the update of the business application in the external network environment. Then, through a network gateway or VPN, the container image is synchronized to the container image repository in data center B, completing the update of the business application in the internal network environment. If the execution of local automated test cases based on this container image fails, the continuous integration server deletes the retrieved newly submitted code and downloaded dependency packages, and then returns to the previous steps of retrieving the newly submitted code, downloading dependency packages, and executing a build task to generate the container image.
[0042] Due to hardware limitations such as network isolation channels or VPN channels, cross-datacenter image transfer speeds are too slow. Taking network isolation channel transfer as an example, the transfer rate is less than 1MB / s, while container images are generally larger than 800MB. It often takes more than 10 minutes to complete the synchronization of container images from the external network environment to the internal network environment. During the waiting window for container image synchronization, the same business application may deploy the new version in the external network data center and use the new version, while still using the old version in the internal network data center. This leads to a problem of version inconsistency between business applications in the internal and external network data centers for a long period of time.
[0043] To address the aforementioned technical issues, this application provides a method for updating a business application. The method involves obtaining the target source code and target dependency packages of a new version of the business application from an external network continuous integration server deployed in an external network environment; the external network continuous integration server sending a first message to an internal network continuous integration server deployed in an internal network environment, the first message indicating the target source code and the target dependency packages; the internal network continuous integration server performing compilation and building based on the target source code and target dependency packages indicated by the first message to generate an internal network container image, thereby updating the business application version within the internal network environment based on the internal network container image; and the external network continuous integration server performing compilation and building based on the target source code and target dependency packages to generate an external network container image, thereby updating the business application version within the external network environment based on the external network container image. In this solution, integration servers are deployed in both external and internal network environments. The external network continuous integration server accesses the public network to obtain the target source code and target dependency packages for the new version of the business application. It then sends a first message indicating the target source code and dependency packages to the internal network continuous integration server. Based on this first message, the internal network continuous integration server obtains the target source code and dependency packages. Both the internal and external network continuous integration servers can then compile and build container images based on the target source code and dependency packages, respectively. Finally, they update the business application version based on their respective generated container images. The data volume of the first message indicating the target source code and dependency packages is much smaller than the container image size, thus significantly reducing the transmission time. Furthermore, the separate compilation and building of container images by the internal and external network continuous integration servers, and their separate updates of the business application version, effectively shortens the time when the business application version is inconsistent between the internal and external network data centers.
[0044] Figure 2 This is a scenario architecture diagram of business application deployment in some embodiments of this application, such as... Figure 2As shown, data center C is where business applications are deployed in an external network environment, and data center D is where business applications are deployed in an internal network environment. Data center C houses an external network continuous integration server (an external network continuous integration server deployed in an external network environment), and data center D houses an internal network continuous integration server (an internal network continuous integration server deployed in an internal network environment). After the external network continuous integration server obtains the newly submitted target source code from the public network and downloads the corresponding target dependency packages, it sends a first message to the internal network continuous integration server indicating the target source code and target dependency packages. Based on the target source code and target dependency packages, it performs compilation and build to generate an external network container image, enabling version updates of the business applications based on the external network container image. Similarly, the internal network continuous integration server performs compilation and build to generate an internal network container image, also enabling version updates of the business applications based on the internal network container image.
[0045] Figure 3 The flowchart illustrates the steps of implementing a service application update method according to one or more embodiments of this application. The service application update method may include the following steps S301 to S305.
[0046] S301. The external network continuous integration server deployed in the external network environment obtains the target source code and target dependency packages of the new version of the business application.
[0047] It is understandable that after developers submit the target source code of a new version of the business application to the project code repository, the external continuous integration server pulls (downloads) the target source code (full package) from the project code repository. The external continuous integration server reads the file describing the dependency package information in the target source code, parses out the list of dependency packages required by the target source code, and then downloads each dependency package corresponding to the target source code from the dependency package repository according to the dependency package list to obtain the target dependency package (full package).
[0048] S302. The external network continuous integration server sends the first message to the internal network continuous integration server deployed in the internal network environment.
[0049] The first message is used to indicate the target source code and the target dependency package, so that the intranet continuous integration server can perform compilation and build based on the target source code and the target dependency package indicated by the first message to generate an intranet container image, so as to realize the version update of the business application based on the intranet container image in the intranet environment.
[0050] S303, the intranet continuous integration server receives the first message from the external network continuous integration server.
[0051] The first message is used to instruct the external network continuous integration server deployed in the external network environment to obtain the target source code and target dependency package of the new version of the business application. The target source code and target dependency package are used by the external network continuous integration server to compile and build an external network container image, so as to realize the version update of the business application based on the external network container image in the external network environment.
[0052] In some embodiments of this application, the external network continuous integration server can directly send the target source code and target dependency packages to the internal network continuous integration server; that is, the first message carries the full package of the target source code and the full package of the target dependency packages. After receiving the first message sent by the external network continuous integration server, the internal network continuous integration server can directly obtain the full package of the target source code and the full package of the target dependency packages from the first message. Thus, directly sending the full package of the target source code and the full package of the target dependency packages through the first message is simple and easy to implement.
[0053] It should be noted that before the external continuous integration server sends the target source code to the internal continuous integration server, it compresses the target source code to obtain compressed target source code. The compressed target source code is then sent to the internal continuous integration server. Upon receiving the compressed target source code, the internal continuous integration server decompresses it to obtain decompressed target source code. Similarly, before the external continuous integration server sends the target dependency package to the internal continuous integration server, it compresses the target dependency package to obtain compressed target dependency package. The internal continuous integration server then decompresses the compressed target dependency package to obtain decompressed target dependency package.
[0054] In some embodiments of this application, the external network continuous integration server can first compare the differences between the target source code and the previous version of the source code to generate a source code differential packet, and compare the differences between the target dependency package and the previous version of the dependency package to generate a dependency package differential packet. Then, the source code differential packet and the dependency package differential packet are sent to the internal network continuous integration server; that is, the first message carries the source code differential packet and the dependency package differential packet. After receiving the first message from the external network continuous integration server, the internal network continuous integration server can directly obtain the source code differential packet and the dependency package differential packet from the first message. Then, based on the source code differential packet and the locally cached source code of the previous version, it generates the target source code, and based on the dependency package differential packet and the locally cached dependency package of the previous version, it generates the target dependency package. Thus, by sending the source code differential packet and the dependency package differential packet through the first message, the size of the data packets transmitted across data centers is greatly reduced, thereby reducing the transmission time.
[0055] It should be noted that before the external continuous integration server sends the source code differential package to the internal continuous integration server, it compresses the source code differential package to obtain a compressed source code differential package. The internal continuous integration server then sends the compressed source code differential package to the internal continuous integration server. Upon receiving the compressed source code differential package, the internal continuous integration server first decompresses it to obtain a decompressed source code differential package. Similarly, before the external continuous integration server sends the dependency package differential package to the internal continuous integration server, it compresses the dependency package differential package to obtain a compressed dependency package differential package. The internal continuous integration server then decompresses the compressed dependency package differential package to obtain a decompressed dependency package differential package.
[0056] S304. The external network continuous integration server compiles and builds an external network container image based on the target source code and the target dependency package, so as to realize the version update of the business application based on the external network container image in the external network environment.
[0057] It is understandable that the intranet continuous integration server compiles and builds an external container image based on the target source code and target dependency packages, and then updates the business application version based on the external container image.
[0058] S305, the intranet continuous integration server compiles and builds the target source code and target dependency packages indicated by the first message to generate an intranet container image, so as to realize the version update of the business application based on the intranet container image in the intranet environment.
[0059] It is understandable that after the intranet continuous integration server obtains the target source code and target dependency packages based on the first message, it can perform compilation and build based on the target source code and target dependency packages to generate an intranet container image, and then update the business application version based on the intranet container image.
[0060] It should be noted that in the embodiments of this application, the execution order of S302 and S304 is not limited. For example, S302 can be executed first and then S304 can be executed, or S304 can be executed first and then S302 can be executed, or S302 and S304 can be executed simultaneously.
[0061] It should be noted that the execution order of S304 and S305 is not limited in this embodiment. For example, S304 can be executed first, followed by S305, or S305 can be executed first, followed by S304, or both S304 and S305 can be executed simultaneously. After obtaining the target source code and target dependency packages, the external network continuous integration server and the internal network continuous integration server can start their local compilation and architecture tasks (i.e., execute local compilation and build respectively) to generate the corresponding container images.
[0062] In this embodiment, integration servers are deployed in both an external network environment and an internal network environment. The external network continuous integration server accesses the public network to obtain the target source code and target dependency packages for the new version of the business application. It then sends a first message indicating the target source code and target dependency packages to the internal network continuous integration server. The internal network continuous integration server obtains the target source code and target dependency packages based on the first message. Both the internal and external network continuous integration servers can then compile and build container images based on the target source code and target dependency packages, respectively. Furthermore, each server updates the business application version based on its generated container image. The data volume of the first message indicating the target source code and target dependency packages is much smaller than the container image volume; therefore, the transmission time of the first message is much shorter than the transmission time of the first message itself. Moreover, since the internal and external network continuous integration servers execute compilation and build to generate container images and update the business application version separately, the time when the business application version is inconsistent between the internal and external network data centers is shortened.
[0063] It is understandable that since the external container image is generated by the external continuous integration server based on the target source code and target dependency packages, and the internal container image is generated by the internal continuous integration server based on the target source code and target dependency packages, the external container image and the internal container image are completely or substantially the same.
[0064] In some embodiments of this application, after an external network continuous integration server generates an external network container image, the external network continuous integration server executes automated test cases based on the external network container image to verify whether there are any problems with the external network container image (and also to verify whether there are any problems with the internal network container image). If the automated test cases are executed successfully, the external network container image is pushed to the container image repository deployed in the external network environment to complete the version update of the business application in the external network environment, and a second message indicating that the automated test cases have been executed successfully is sent to the internal network continuous integration server. Based on the second message, the internal network continuous integration server pushes the internal network container image to the container image repository deployed in the internal network environment to complete the version update of the business application in the internal network environment.
[0065] In some embodiments of this application, combined with Figure 3 ,like Figure 4 As shown, after S304 above, the business application update method provided in this application embodiment may further include S306 to S310 below.
[0066] S306, the external network continuous integration server executes automated test cases based on the external network container image.
[0067] S307. If the external network continuous integration server successfully executes the automated test case, it sends a second message to the internal network continuous integration server.
[0068] The second message is used by the intranet continuous integration server to push the intranet container image to the container image repository deployed in the intranet environment, so as to realize the version update of the business application in the intranet environment.
[0069] The second message indicates that the external network continuous integration server has successfully executed automated test cases based on the external network container image.
[0070] S308, The intranet continuous integration server receives the second message from the external network continuous integration server.
[0071] The second message indicates that the external network continuous integration server has successfully executed automated test cases based on the external network container image. The external network container image is used by the external network continuous integration server to push the external network container image to the container image repository deployed in the external network environment, so as to realize the version update of the business application in the external network environment.
[0072] The second message can specifically be "Automated test cases based on external container images were executed successfully", "Verification of external container images was successful", "Verification shows that there are no problems with external container images", or "The new version of the business application has no problems", etc. The specific message can be determined according to the actual situation and is not limited here.
[0073] It is understandable that after the intranet continuous integration server receives the second message, it can determine that there is no problem with the intranet container image. By pushing the intranet container image to the container image repository deployed in the intranet environment, the version update of the business application in the intranet environment can be achieved.
[0074] S309. The external network continuous integration server pushes the external network container image to the container image repository deployed in the external network environment to enable version updates of the business application in the external network environment.
[0075] Based on the second message, the S310 and intranet continuous integration server push the intranet container image to the container image repository deployed in the intranet environment to enable version updates of the business application in the intranet environment.
[0076] In this embodiment, since the external network container image and the internal network container image are completely or substantially the same, executing automated test cases based on the external network container image solely through the external network continuous integration server can verify whether there are problems with the external network container image and the internal network container image, and further verify whether there are problems with the target source code and target dependency packages of the new version, and whether there are problems with the new version of the business application. Moreover, executing automated test cases based on the external network container image solely through the external network continuous integration server, and sending a second message to the internal network continuous integration server when the automated test cases are successfully executed, can ensure that the time when the external network continuous integration server pushes the external network container image to the container image repository deployed on the external network is closer to the time when the internal network continuous integration server pushes the internal network container image to the container image repository deployed on the internal network, which is more conducive to shortening the time when the version of the business application is inconsistent between the internal and external network data centers.
[0077] In some embodiments of this application, the existence of problems with the corresponding container images can be verified in both the intranet and extranet environments. Specifically, after the extranet continuous integration server generates an extranet container image, it executes automated test cases based on the extranet container image to verify whether there are any problems with the extranet container image. If the automated test cases execute successfully, the extranet container image is pushed to the container image repository deployed in the extranet environment to complete the version update of the business applications in the extranet environment. Similarly, after the intranet continuous integration server generates an intranet container image, it executes automated test cases based on the intranet container image to verify whether there are any problems with the intranet container image. If the automated test cases execute successfully, the intranet container image is pushed to the container image repository deployed in the intranet environment to complete the version update of the business applications in the intranet environment.
[0078] In some embodiments of this application, the first message carries the full package of the target source code and the full package of the target dependency packages. The external network continuous integration server can directly send the acquired target source code and downloaded target dependency packages to the internal network continuous integration server via the first message. Then, the internal network continuous integration server performs compilation and build based on the target source code and target dependency packages carried in the first message to generate an internal network container image. This process is simple and easy to implement.
[0079] In some embodiments of this application, the first message carries a source code differential package and a dependency package differential package. The source code differential package is used to indicate the difference between the source code of the previous version of the business application and the target source code. The source code differential package is used by the intranet continuous integration server to generate the target source code based on the source code differential package and the locally cached source code of the previous version. The dependency package differential package is used to indicate the difference between the dependency package of the previous version of the business application and the target dependency package. The dependency package differential package is used by the intranet continuous integration server to generate the target dependency package based on the dependency package differential package and the locally cached dependency package of the previous version.
[0080] In some embodiments of this application, combined with Figure 4 ,like Figure 5 As shown, after S301 above, the business application update method provided in this application embodiment may further include S311 to S312 below, and before S305 above, the business application update method provided in this application embodiment may further include S313 to S314 below.
[0081] S311. The external network continuous integration server generates a source code differential package based on the differences between the source code of the previous version of the business application and the source code of the target application.
[0082] It is understandable that the external continuous integration server compares the target source code with the previous version of the source code to determine the differences between the new version of the target source code and the previous version of the source code. For example, compared with the previous version of the source code, which code files have been added, modified, or deleted in the target source code, etc., and then generates a source code difference package based on the differences between the new version of the target source code and the previous version of the source code.
[0083] The source code differential packets are transmitted to the intranet continuous integration server through a network gateway or VPN tunnel.
[0084] S312. The external network continuous integration server generates a dependency package difference package based on the differences between the dependency package of the previous version of the business application and the target dependency package.
[0085] It is understandable that the external continuous integration server compares the target dependency package (corresponding dependency package list) with the previous version's dependency package (corresponding dependency package list) to determine the differences between the new version's target dependency package and the previous version's dependency package. For example, compared to the previous version's dependency package, which dependency files have been added, modified, or deleted in the target dependency package, etc., and then generates a dependency package difference package based on the differences between the new version's target dependency package and the previous version's dependency package.
[0086] In this embodiment of the application, the target dependency package includes at least one dependency package, the previous version of the dependency package may include at least one dependency package, and a dependency file may be a dependency package.
[0087] Among them, the dependency packet differential packet is transmitted to the intranet continuous integration server through the network gateway or VPN channel.
[0088] S313, the intranet continuous integration server generates the target source code based on the source code differential package and the source code of the previous version cached locally.
[0089] The source code differential package includes identification information indicating the previous version of the source code, as well as the differences between the target source code and the previous version of the source code.
[0090] After receiving the source code differential packet, the intranet continuous integration server retrieves the source code of the previous version from the local cache based on the identification information, and then updates the source code of the previous version according to the source code differential packet to obtain the target source code.
[0091] For example, updating the source code of the previous version according to the source code difference package includes: if the source code difference package records that the first code file in the source code of the previous version has been deleted from the target source code, deleting the first code file in the source code of the previous version; if the source code difference package records that the second code file in the source code of the previous version has been modified in the target source code, replacing the second code file in the source code of the previous version with the second file in the source code difference package (overwriting the second code file before modification in the source code of the previous version with the second code file in the source code of the new version); if the source code difference package records that a third code file has been added to the target source code (the source code of the previous version does not include the third code file), adding the third code file to the source code of the previous version.
[0092] S314. The intranet continuous integration server generates the target dependency package based on the differential package of the dependency package and the previously cached dependency package of the same version.
[0093] The dependency package difference package includes identification information indicating the dependency package of the previous version, as well as the differences between the target dependency package and the dependency package of the previous version.
[0094] After receiving the dependency package differential package, the intranet continuous integration server retrieves the previous version of the dependency package from the local cache based on the identification information, and then updates the previous version of the dependency package according to the dependency package differential package to obtain the target dependency package.
[0095] For example, updating the dependency package of the previous version based on the dependency package differential package includes: deleting the first dependency file in the previous version's dependency package if the first dependency file in the target dependency package has been deleted in the dependency package differential package; replacing the second dependency file in the previous version's dependency package with the second dependency file in the dependency package differential package (overwriting the second dependency file in the previous version's dependency package before modification) if the second dependency file in the target dependency package differential package has been modified in the dependency package differential package; and adding the third dependency file in the previous version's dependency package if the third dependency file has been added in the target dependency package differential package (the third dependency file was not included in the previous version's dependency package).
[0096] In this embodiment, the external network continuous integration server generates a source code differential package based on the differences between the target source code and the previous version of the source code. The internal network continuous integration server generates the target source code based on the source code differential package and the locally cached source code of the previous version. The external network continuous integration server generates a dependency package differential package based on the differences between the target dependency package and the previous version of the dependency package. The internal network continuous integration server generates the target source code based on the dependency package differential package and the locally cached dependency package of the previous version. In this way, the transmission of the target source code and target dependency package between the external network continuous integration server and the internal network continuous integration server is realized through the source code differential package and the dependency package differential package, effectively shortening the transmission time.
[0097] In some embodiments of this application, such as Figure 6 As shown, the above S311 can be implemented by at least one of the following S401 to S403.
[0098] S401. If, compared with the target source code, the previous version of the source code exists, the external network continuous integration server determines that the source code differential package includes at least one code file identifier, and each code file identifier is used to indicate a code file that needs to be deleted.
[0099] It is understandable that if the external continuous integration server finds that at least one code file needs to be deleted compared to the target source code in the previous version of the source code, it will add an identifier for at least one code file to the source code differential package. Based on this identifier, the internal continuous integration server can then determine which code files (the at least one code file) in the previous version of the source code need to be deleted.
[0100] S402. If, compared with the target source code, there is at least one code file that needs to be updated in the previous version of the source code, the external continuous integration server determines that the source code differential package includes each updated code file corresponding to the at least one code file that needs to be updated.
[0101] It is understandable that if the external continuous integration server finds that at least one code file in the previous version of the source code needs to be updated compared to the target source code, it will add each updated code file to the source code differential package. Based on the updated code files in the source code differential package, the internal continuous integration server can then determine which code files in the previous version of the source code (the at least one code file that needs to be updated) need to be overwritten.
[0102] In some embodiments of this application, if the external network continuous integration server determines that the source code differential package includes file identifiers of each updated code file when there is at least one code file that needs to be updated compared to the target source code in the previous version of the source code, the external network continuous integration server can also determine file identifiers of each updated code file.
[0103] S403. If, compared with the target source code, the previous version of the source code of the external network continuous integration server has at least one code file that needs to be added, the source code differential package is determined to include the at least one code file that needs to be added.
[0104] It is understandable that if the external continuous integration server finds that at least one additional code file needs to be added compared to the target source code in the previous version of the source code, it will add that at least one additional code file to the source code differential package. The internal continuous integration server can then determine which code files need to be added to the previous version of the source code (the at least one additional code file) based on the additional code files in the source code differential package.
[0105] In some embodiments of this application, if the external network continuous integration server determines that the source code differential package includes the code file identifiers of each code file that needs to be added, when there is at least one code file that needs to be added compared to the source code of the previous version.
[0106] For example, if the target source code, compared to the previous version, has added one code file (code file 1), modified two code files (code file 2 and code file 3), and deleted one code file (code file 4), then the source code differential package can include a source code change log file and the newly added code file 1, as well as the modified code files 2 and 3. The source code change log file can record the identification information of the previous version of the source code, the file identifier of the newly added code file 1, the file identifiers of the modified code files 2 and 3, and the file identifier of the deleted code file; it can also record the identification information of the previous version of the source code and the file identifier of the deleted code file. The specific details can be determined according to the actual situation and are not limited here.
[0107] This application provides a method for generating a source code differential package based on the target source code and the source code of the previous version.
[0108] In some embodiments of this application, such as Figure 7 As shown, the above S312 can be implemented by at least one of the following S501 to S503.
[0109] S501. If, compared with the target dependency package, the previous version of the dependency package exists, the external network continuous integration server determines that the dependency package differential package includes at least one dependency file identifier, and each dependency file identifier is used to indicate a dependency file that needs to be deleted.
[0110] It is understandable that if the external continuous integration server finds that at least one dependency file needs to be deleted compared to the target dependency package in the previous version of the dependency package, it will add at least one dependency file identifier to the dependency package differential package. The internal continuous integration server can then determine which dependency files (at least one dependency file that needs to be deleted) in the previous version of the dependency package based on the at least one dependency file identifier in the dependency package differential package.
[0111] S502. If, compared with the target dependency package, the previous version of the dependency package exists, the external network continuous integration server determines that the dependency package differential package includes each updated dependency file corresponding to the at least one dependency file that needs to be updated.
[0112] It is understandable that if the external continuous integration server finds that at least one dependency file in the previous version of the dependency package needs to be updated compared to the target dependency package, it will add the updated dependency files to the dependency package differential package. The internal continuous integration server can then determine which dependency files in the previous version of the dependency package (at least one dependency file that needs to be updated) need to be overwritten based on the updated dependency files in the dependency package differential package.
[0113] In some embodiments of this application, if the external network continuous integration server determines that the dependency package differential package includes dependency file identifiers corresponding to each updated dependency package file when there is at least one dependency file that needs to be updated compared to the target dependency package in the previous version of the dependency package.
[0114] S503. If, compared with the target dependency package, the previous version of the dependency package has at least one additional dependency file, the external network continuous integration server determines that the dependency package differential package includes the at least one additional dependency file.
[0115] It is understandable that if the external continuous integration server finds that at least one additional dependency file needs to be added compared to the target dependency package in the previous version of the dependency package, it will add the at least one additional dependency file to the dependency package differential package. The internal continuous integration server can then determine which dependency files (at least one additional dependency file) need to be added to the previous version of the dependency package based on the at least one additional dependency file in the dependency package differential package.
[0116] In some embodiments of this application, if the external network continuous integration server determines that the dependency package differential package includes dependency file identifiers for each dependency file that needs to be added, when there is at least one dependency file that needs to be added compared to the previous version of the dependency package.
[0117] For example, if the target dependency package, compared to the previous version, adds one dependency file (dependency file A), upgrades one dependency file (dependency file B), and deletes one dependency file (dependency file C), then the dependency package differential package can include a dependency package change log file and the newly added dependency file A and the upgraded dependency file B. The dependency package change log file can record the identifier information of the previous version of the dependency package, the file identifier of the newly added dependency file A, the file identifier of the upgraded dependency file B, and the file identifier of the deleted dependency file C; it can also record the identifier information of the previous version of the dependency package and the file identifier of the deleted dependency file C; the specific details can be determined according to the actual situation and are not limited here.
[0118] It should be noted that if there is at least one dependency file that needs to be deleted compared to the target dependency package in the previous version, the above S501 may not be executed. This is because not deleting the at least one dependency file that needs to be deleted in the previous version of the dependency package will not affect the compilation and building based on the target source code and the target dependency package, and will not affect the generated container image.
[0119] This application provides a method for generating a dependency package differential package based on the target dependency package and the dependency package of the previous version.
[0120] In some embodiments of this application, combined with Figure 5 ,like Figure 8 As shown, after S313 above, the business application update method provided in this application embodiment may include S315 below; after S314 above, the business application update method provided in this application embodiment may include S316 below.
[0121] S315, The intranet continuous integration server caches the source code of this target.
[0122] S316. The intranet continuous integration server caches the target dependency package.
[0123] In this embodiment of the application, the intranet continuous integration server caches the target source code and the target dependency package so that when the business application is updated next time, the target source code is used as the source code of the previous version, and the new version source code is generated by combining the new version source code differential package; the target dependency package is used as the dependency package of the previous version, and the new version dependency package is generated by combining the new version dependency package differential package.
[0124] In some embodiments of this application, the first message may be one message or two messages, which can be determined according to the actual situation and is not limited here.
[0125] If the first message is a single message, then the full package of the target source code and the full package of the target dependency package are transmitted simultaneously through the first message, or the differential package of the source code and the differential package of the dependency package are transmitted simultaneously through the first message.
[0126] If the first message consists of two messages, then one message transmits the full package or differential package of the target source code, while the other message transmits the target dependency package or differential package. In this embodiment, since the external network continuous integration server obtains the target source code and target dependency package separately, the first message consists of two messages. The corresponding data packets are transmitted through these two messages. After obtaining the target source code, the corresponding data packet (full package or differential package) is transmitted first. Then, after obtaining the target dependency package, the corresponding data packet (full package or differential package) is transmitted. There is no need to wait for the external network continuous integration server to obtain the target source code and target dependency package before sending them to the internal network continuous integration server. Furthermore, the external network continuous integration server can send the target source code data packet to the internal network continuous integration server and download the target dependency package from the dependency package repository in parallel. This saves waiting time, shortens the time for the internal network continuous integration server to obtain the target source code and target dependency package, and improves the efficiency of the internal network continuous integration server in obtaining the target source code and target dependency package.
[0127] In some embodiments of this application, such as Figure 9 As shown, the business application update method provided in this application embodiment may include the following steps S601 to S618.
[0128] S601, the external network continuous integration server obtains the target source code from the project code repository.
[0129] S602: The external network continuous integration server compares the differences between the target source code and the previous version of the source code, and generates a source code differential package.
[0130] S603: The external network continuous integration server sends source code differential packets to the internal network continuous integration server.
[0131] After receiving the source code differential package, the S604 intranet continuous integration server combines the source code differential package with the source code of the previous version cached locally to generate the target source code.
[0132] S605, the external network continuous integration server obtains the target dependency package corresponding to the target source code from the dependency package repository.
[0133] S606: The external network continuous integration server compares the differences between the target dependency package and the previous version dependency package, and generates a dependency package difference package.
[0134] S607. The external network continuous integration server sends a dependency differential packet to the internal network continuous integration server.
[0135] After receiving the dependency package differential package, the S608 intranet continuous integration server combines the dependency package differential package with the previously cached dependency package to generate the target dependency package.
[0136] S609, the external network continuous integration server compiles and builds an external network container image based on the target source code and target dependency packages.
[0137] The S610 intranet continuous integration server compiles and builds an intranet container image based on the target source code and target dependency packages.
[0138] S611, the external network continuous integration server executes automated test cases based on the external network container image.
[0139] S612, when the automated test cases are executed successfully, the external network continuous integration server pushes the external network container image to the container image repository corresponding to the external network environment.
[0140] S613, The external network continuous integration server notifies the internal network continuous integration server that the automated test cases have been executed successfully.
[0141] S614. The intranet continuous integration server pushes intranet container images to the container image repository corresponding to the intranet environment.
[0142] S615, the intranet continuous integration server caches the target source code and target dependency packages.
[0143] S616. In the event that the automated test cases fail to execute, the external network continuous integration server deletes the external network container image.
[0144] S617. The external network continuous integration server notifies the internal network continuous integration server that the automated test case execution failed.
[0145] S618, the intranet continuous integration server deletes the intranet container image if it has already been generated, and terminates the local compilation and build task based on the target source code and target dependency packages if the intranet container image has not been generated, and deletes the temporary files generated by the compilation and build.
[0146] In this embodiment, after obtaining the target source code and target dependency packages, the external network continuous integration server and the internal network continuous integration server can respectively start their local compilation and build tasks to generate the corresponding container images. After completing the compilation and build to generate the external network container image, the external network continuous integration server continues to execute automated test cases, while the internal network continuous integration server stops executing automated test cases after completing the compilation and build to generate the internal network container image. If all automated test cases of the external network continuous integration server pass (execute successfully), the external network continuous integration server will push the external network container image to the container image repository corresponding to the external network environment, and at the same time, notify the internal network continuous integration server that the automated test cases have executed successfully. After receiving the message that the automated test execution is successful, the internal network continuous integration server will also push the internal network container image to the container image repository corresponding to the internal network environment, and save the target source code and target dependency packages locally for use in the next version upgrade. If any of the automated test cases of the external network continuous integration server fail, the external network continuous integration server deletes the external network container image and notifies the internal network continuous integration server that the automated test cases have failed. If the compilation and build task of the intranet continuous integration server is not yet completed at this time, the intranet continuous integration server will immediately terminate the compilation and build task, delete the temporary files corresponding to the compilation and build, and delete the target source code and target dependency packages.
[0147] Combination Figure 9 ,like Figure 10As shown, considering the successful execution of automated test cases, the entire continuous integration process can be analyzed in parallel on the external network continuous integration server. This includes generating source code differential packages based on the target source code and the previous version's source code, downloading target dependency packages, generating dependency differential packages based on the target dependency packages and the previous version's dependency packages, and performing compilation and building. On the internal network continuous integration server, downloading source code differential packages and generating target source code based on these packages and the previous version's source code can be done simultaneously with the external network continuous integration server downloading dependency packages. Similarly, downloading dependency differential packages and generating target dependency packages based on these packages and the previous version's dependency packages can be done in parallel with the external network continuous integration server performing compilation and building. Therefore, the compilation and building tasks on the internal network continuous integration server start later than those on the external network (it needs to wait for the dependency differential packages to finish downloading before starting the internal network compilation and building). Compared to the external network, the internal network saves time spent executing automated test cases. Since automated test cases are executed only on the external network continuous integration server side, upon successful execution of an automated test case, the external network continuous integration server notifies the internal network continuous integration server of the successful execution. It then pushes the external network container image to the corresponding container image repository for the external environment. The internal network continuous integration server, based on the notification message of successful execution of the automated test case, pushes the internal network container image to the corresponding container image repository for the internal network environment. Therefore, under normal circumstances, the external and internal networks can simultaneously push their respective generated container images to their respective container image repositories, achieving synchronous integration between the two data centers and enabling simultaneous updates of business applications in both internal and external network environments. Furthermore, based on the above... Figure 10 The aforementioned execution process can effectively shorten the time for business applications to perform version updates in both internal and external network environments, and can also effectively shorten the time when business applications experience version inconsistencies between internal and external network environments.
[0148] Figure 11 This is a structural block diagram of a service application update apparatus shown in an embodiment of this disclosure, such as... Figure 11 As shown, the device includes: an acquisition module 701, a transmission module 702, and a generation module 703; wherein:
[0149] The acquisition module 701 is used to acquire the target source code and target dependency package of a new version of the business application; the sending module 702 is used to send a first message to the intranet continuous integration server deployed in the intranet environment. The first message is used to instruct the acquisition module to acquire the target source code and target dependency package, so that the intranet continuous integration server can perform compilation and build based on the target source code and target dependency package indicated by the first message to generate an intranet container image, so as to realize the version update of the business application based on the intranet container image in the intranet environment; the generation module 703 is used to perform compilation and build based on the target source code and target dependency package acquired by the acquisition module to generate an external container image, so as to realize the version update of the business application based on the external container image in the external network environment.
[0150] In some embodiments of this application, the device further includes an execution module and a push module; the execution module is used to execute automated test cases based on the external network container image after compiling and building an external network container image based on the target source code and the target dependency package; the sending module 702 is further used to send a second message to the internal network continuous integration server when the automated test case is successfully executed, the second message being used by the internal network continuous integration server to push the internal network container image to the container image repository deployed in the internal network environment, so as to realize the version update of the business application in the internal network environment; the push module is used to push the external network container image to the container image repository deployed in the external network environment, so as to realize the version update of the business application in the external network environment.
[0151] In some embodiments of this application, the generation module is further configured to, before sending the first message to the intranet continuous integration server, generate a source code differential package based on the difference between the source code of the previous version of the business application and the target source code; generate a dependency package differential package based on the difference between the dependency package of the previous version of the business application and the target dependency package; the first message carries the source code differential package and the dependency package differential package, wherein the source code differential package is used by the intranet continuous integration server to generate the target source code based on the source code differential package and the locally cached source code of the previous version, and the dependency package differential package is used by the intranet continuous integration server to generate the target dependency package based on the dependency package differential package and the locally cached dependency package of the previous version.
[0152] In some embodiments of this application, the generation module is specifically configured to: determine that the source code differential package includes at least one code file identifier, each code file identifier indicating a code file to be deleted, when there is at least one code file to be deleted compared to the target source code in the previous version of the source code; determine that the source code differential package includes each updated code file corresponding to the at least one code file to be updated, when there is at least one code file to be added compared to the target source code in the previous version of the source code; and determine that the source code differential package includes the at least one code file to be added, when there is at least one code file to be added compared to the target source code in the previous version of the source code.
[0153] In some embodiments of this application, the generation module is specifically configured to: determine that the dependency package differential package includes at least one dependency file identifier, each dependency file identifier indicating a dependency file that needs to be deleted, when there is at least one dependency file that needs to be deleted compared to the target dependency package in the previous version of the dependency package; determine that the dependency package differential package includes each updated dependency file corresponding to the at least one dependency file that needs to be updated, when there is at least one dependency file that needs to be added compared to the target dependency package in the previous version of the dependency package; and determine that the dependency package differential package includes the at least one dependency file that needs to be added, when there is at least one dependency file that needs to be added compared to the target dependency package in the previous version of the dependency package.
[0154] In this embodiment, each module of the business application update device can implement the business application update method provided in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0155] Figure 12 This is a structural block diagram of a service application update apparatus shown in an embodiment of this disclosure, such as... Figure 12 As shown, the device includes: a receiving module 801 and a generating module 802; wherein:
[0156] The receiving module 801 is used to receive a first message from an external network continuous integration server deployed in an external network environment. The first message indicates that the external network continuous integration server has obtained the target source code and target dependency package of a new version of the business application. The target source code and the target dependency package are used by the external network continuous integration server to compile and build an external network container image, so as to implement the version update of the business application based on the external network container image in the external network environment. The generating module 802 is used to compile and build an internal network container image based on the target source code and the target dependency package indicated by the first message received by the receiving module, so as to implement the version update of the business application based on the internal network container image in the internal network environment.
[0157] In some embodiments of this application, the device further includes a push module; the receiving module 801 is further configured to receive a second message from the external network continuous integration server after the target source code and target dependency package indicated by the first message are compiled and built to generate an internal network container image, the second message being used to indicate that the external network continuous integration server has successfully executed automated test cases based on the external network container image, the external network container image being used by the external network continuous integration server to push the external network container image to a container image repository deployed in the external network environment to achieve version updates of the business application in the external network environment; the push module is configured to push the internal network container image to a container image repository deployed in the internal network environment based on the second message to achieve version updates of the business application in the internal network environment.
[0158] In some embodiments of this application, the first message carries the source code differential package and the dependency package differential package. The source code differential package is used to indicate the difference between the source code of the previous version of the business application and the target source code, and the dependency package differential package is used to indicate the difference between the dependency package of the previous version of the business application and the target dependency package. The generation module 802 is further configured to generate the target source code based on the source code differential package and the locally cached source code of the previous version before performing compilation and building to generate the intranet container image based on the target source code and the target dependency package indicated by the first message; and to generate the target dependency package based on the dependency package differential package and the locally cached dependency package of the previous version.
[0159] In this embodiment, each module of the business application update device can implement the business application update method provided in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0160] like Figure 13 As shown, this application embodiment also provides a computing device 900, which can be the aforementioned electronic device or server. The computing device 900 includes a processor 901, a memory 902, and a computer program stored in the memory 902 and executable on the processor 901. When executed by the processor 901, the computer program performs the various processes described in the above-described business application update method and achieves the same technical effect. To avoid repetition, further details are omitted here.
[0161] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described business application update method and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0162] The computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0163] The present invention provides a computer program product, comprising: when the computer program product is run on a computer, causing the computer to implement the above-described business application update method.
[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0165] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A method for updating business applications, characterized in that, External network continuous integration servers deployed in external network environments include: Obtain the target source code and target dependency packages for the new version of the business application; Send a first message to the intranet continuous integration server deployed in the intranet environment. The first message is used to indicate the target source code and the target dependency package, so that the intranet continuous integration server and the external network continuous integration server can perform compilation and build to generate an intranet container image based on the target source code and target dependency package indicated by the first message in parallel, so as to realize the version update of the business application based on the intranet container image in the intranet environment. Based on the target source code and the target dependency package, a compilation and build process is performed to generate an external container image, so as to implement version updates of the business application in the external network environment based on the external container image; Automated test cases are executed based on the external network container image; If the automated test case is executed successfully, a second message is sent to the intranet continuous integration server. The second message is used by the intranet continuous integration server to push the intranet container image to the container image repository deployed in the intranet environment, so as to realize the version update of the business application in the intranet environment. The external network container image is pushed to the container image repository deployed in the external network environment to enable version updates of the business application in the external network environment.
2. The method according to claim 1, characterized in that, Before sending the first message to the intranet continuous integration server, the method further includes: Based on the differences between the source code of the previous version of the business application and the target source code, a source code differential package is generated; Based on the differences between the dependency packages of the previous version of the business application and the target dependency package, a dependency package differential package is generated; The first message carries the source code differential package and the dependency package differential package. The source code differential package is used by the intranet continuous integration server to generate the target source code based on the source code differential package and the source code of the previous version cached locally. The dependency package differential package is used by the intranet continuous integration server to generate the target dependency package based on the dependency package differential package and the dependency package of the previous version cached locally.
3. The method according to claim 2, characterized in that, The process of generating a source code differential package based on the differences between the source code of the previous version of the business application and the target source code includes: If, compared with the target source code, there is at least one code file that needs to be deleted in the previous version of the source code, it is determined that the source code differential package includes at least one code file identifier, and each code file identifier is used to indicate a code file that needs to be deleted; If, compared with the target source code, there is at least one code file that needs to be updated in the previous version of the source code, the source code differential package is determined to include each updated code file corresponding to the at least one code file that needs to be updated; If, compared to the target source code, there is at least one code file that needs to be added in the previous version of the source code, then the source code differential package is determined to include the at least one code file that needs to be added.
4. The method according to claim 2, characterized in that, The process of generating a dependency package difference based on the differences between the dependency package of the previous version of the business application and the target dependency package includes: If, compared with the target dependency package, the previous version of the dependency package contains at least one dependency file that needs to be deleted, it is determined that the dependency package differential package includes at least one dependency file identifier, and each dependency file identifier is used to indicate a dependency file that needs to be deleted. If, compared with the target dependency package, there is at least one dependency file that needs to be updated in the previous version of the dependency package, the dependency package differential package is determined to include each updated dependency file corresponding to the at least one dependency file that needs to be updated. If, compared to the target dependency package, the previous version of the dependency package contains at least one additional dependency file, then the dependency package differential package is determined to include the at least one additional dependency file.
5. A method for updating business applications, characterized in that, Intranet continuous integration servers deployed in intranet environments include: The system receives a first message from an external network continuous integration server deployed in an external network environment. The first message is used to instruct the external network continuous integration server to obtain the target source code and target dependency package of a new version of the business application. The target source code and the target dependency package are used by the external network continuous integration server to compile and build an external network container image, so as to implement the version update of the business application based on the external network container image in the external network environment. Based on the target source code and target dependency package indicated by the first message, a compilation and build process is performed to generate an intranet container image, so as to implement version updates of the business application in the intranet environment based on the intranet container image, wherein the intranet continuous integration server and the extranet continuous integration server perform the compilation and build process in parallel. After generating the intranet container image, a second message is received from the external network continuous integration server. The second message is used to indicate that the external network continuous integration server has successfully executed automated test cases based on the external network container image. The external network container image is used by the external network continuous integration server to push the external network container image to the container image repository deployed in the external network environment, so as to realize the version update of the business application in the external network environment. Based on the second message, the intranet container image is pushed to the container image repository deployed in the intranet environment to enable version updates of the business application in the intranet environment.
6. The method according to claim 5, characterized in that, The first message carries a source code differential package and a dependency package differential package. The source code differential package is used to indicate the difference between the source code of the previous version of the business application and the target source code. The dependency package differential package is used to indicate the difference between the dependency package of the previous version of the business application and the target dependency package. Before the method performs compilation and build to generate an intranet container image based on the target source code and target dependency package indicated by the first message, the method further includes: The target source code is generated based on the source code differential package and the previously cached source code in the local cache. The target dependency package is generated based on the dependency package differential package and the previously cached dependency package in the local cache.
7. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1 to 4.
8. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 5 to 6.
Citation Information
Patent Citations
Automated deployment method and device, medium, and electronic device
CN109358858A
Software package warehouse on-demand mirroring method, device and system
CN110908703A
