Private server dependent source code management method and device
By building a private server dependent source code warehouse, unified management and call third-party and private dependent source code, the problem of securely obtaining and managing dependent source code in the existing technology is solved, and efficient and secure dependent source code management is achieved.
Patent Information
- Application Number
- CN202411714646.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-27
AI Technical Summary
It is difficult for the existing technology to securely obtain third-party dependent source code, and to uniformly manage internal dependent source code and third-party dependent source code, which poses the risk of sensitive information leakage and data tampering.
By building a private server dependent source code warehouse, obtaining the index files of the third-party dependent code, building a target code project, uploading the external dependent index source code and the third-party dependent source code to the private server warehouse, creating the index files of the private dependent code and uploading it, realizing unified management and calling of the third-party and private dependent source code.
It realizes secure unified management of third-party and private dependent source code, improves development efficiency, and prevents unauthorized access and malicious attacks.
Smart Images

Figure CN119645371A_ABST
Abstract
Description
Technical Field
[0001] This specification belongs to the field of financial technology, and in particular, relates to a management method and device for private servers that rely on source code. Background Art
[0002] During the software development process, a large number of resources are relied upon, including dependent source code from internal repositories and third-party dependent source code from external repositories.
[0003] However, when the development team directly accesses the third-party dependent source code in the external warehouse, the integrity and reliability of the third-party dependent source code cannot be guaranteed, so there is a risk of sensitive information being leaked and data being tampered with. Due to security or network policy restrictions in the software development process, the development team may not be able to directly access external dependent third-party libraries, resulting in the inability to smoothly obtain the required dependent source code during the development process, affecting the development progress.
[0004] There is currently no effective solution for how to securely obtain third-party dependent source code and uniformly manage internal dependent source code and third-party dependent source code. Summary of the invention
[0005] The present application provides a method and device for managing private server dependency source code, which achieves the effect of unified management of third-party dependency source code and private dependency source code by building a private server dependency source code warehouse.
[0006] The present application provides a method and device for managing private server-dependent source code, which is implemented as follows:
[0007] A method for managing private server dependent source code, comprising:
[0008] Create a private server dependent source code repository for the target source code management system;
[0009] Get the index file of the third-party dependent code of the target source code management system;
[0010] Building a target code project according to the index file of the third-party dependent code;
[0011] According to the address of the target code project, uploading the external dependency index source code to the private server dependency source code warehouse;
[0012] According to the external dependency index source code, obtain the address of the third-party dependency source code;
[0013] According to the address of the third-party dependent source code, uploading the third-party dependent source code to the private server dependent source code warehouse;
[0014] Create an index file of the private dependency code of the target source code management system;
[0015] Upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code;
[0016] According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called.
[0017] In one embodiment, uploading the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code includes:
[0018] Verifying the validity of the index file of the private dependency code;
[0019] If the index file of the private dependency code is valid, determine the name of the private service dependency source code warehouse and the upload path of the index file of the private dependency code;
[0020] According to the name of the private server dependency source code warehouse and the upload path of the index file of the private dependency code, the private index source code and the private dependency source code are uploaded to the private server dependency source code warehouse.
[0021] In one embodiment, verifying the validity of the index file of the private dependency code includes:
[0022] Check whether the index file of the private dependency code has syntax errors;
[0023] Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.
[0024] In one embodiment, after verifying the validity of the index file of the private dependency code, the method further includes:
[0025] In the case where the index file of the private dependent code is invalid, determining the problem type of the index file of the private dependent code and the location where the problem occurs according to the error information in the verification result;
[0026] Correct the problem according to the type of problem and the location where the problem occurs;
[0027] The validity of the index file of the private dependency code is verified again until the verification passes.
[0028] In one embodiment, the method further includes: calling the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and before calling the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse:
[0029] Configuring user access rights and audit logs for the private server dependent source code warehouse, wherein different users are configured with different access rights to the private server dependent source code warehouse;
[0030] The user's access is controlled based on the user's access rights and audit logs.
[0031] In one embodiment, calling the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and calling the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse, including:
[0032] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code;
[0033] According to the address of the external dependency index source code, obtain the corresponding third-party dependency source code;
[0034] According to the address of the private index source code, obtain the corresponding private dependency source code;
[0035] Install, compile and package the acquired third-party dependency source code and / or private dependency source code.
[0036] A management device for private server dependent source code, comprising:
[0037] The first creation module is used to create a private server dependent source code repository of the target source code management system;
[0038] A first acquisition module is used to acquire an index file of third-party dependent code of a target source code management system;
[0039] A second creation module is used to build a target code project according to the index file of the third-party dependent code;
[0040] A first uploading module, used to upload the external dependency index source code to the private server dependency source code warehouse according to the address of the target code project;
[0041] A second acquisition module is used to acquire the address of the third-party dependency source code according to the external dependency index source code;
[0042] A second uploading module is used to upload the third-party dependent source code to the private server dependent source code warehouse according to the address of the third-party dependent source code;
[0043] The third creation module is used to create an index file of the private dependency code of the target source code management system;
[0044] A third uploading module is used to upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code;
[0045] The calling module is used to call the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and to call the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse.
[0046] An electronic device comprises a processor and a memory for storing instructions executable by the processor, wherein the processor implements the steps of any one of the above methods when executing the instructions.
[0047] A computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the steps of any of the above methods.
[0048] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
[0049] The present application provides a method and device for managing private service dependency source code, including: creating a private service dependency source code warehouse of a target source code management system; obtaining an index file of a third-party dependency code of a target source code management system; building a target code project according to the index file of the third-party dependency code; uploading an external dependency index source code to the private service dependency source code warehouse according to the address of the target code project; obtaining the address of the third-party dependency source code according to the external dependency index source code; uploading the third-party dependency source code to the private service dependency source code warehouse according to the address of the third-party dependency source code; creating an index file of a private dependency code of a target source code management system; uploading the private index source code and the private dependency source code to the private service dependency source code warehouse through the index file of the private dependency code; calling the third-party dependency source code in the private service dependency source code warehouse according to the external dependency index source code in the private service dependency source code warehouse, and calling the private service dependency source code in the private service dependency source code warehouse according to the private index source code in the private service dependency source code warehouse. The above scheme can uniformly manage third-party dependency source code and private dependency source code, thereby improving the development efficiency of the project team. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 It is a method flow chart of an embodiment of a method for managing private server dependent source code provided by the present application;
[0052] Figure 2 It is a flowchart of an embodiment of a method for managing private server dependent source code provided by the present application;
[0053] Figure 3 It is a hardware structure block diagram of an electronic device for a private server-dependent source code management method provided by the present application;
[0054] Figure 4 It is a schematic diagram of the module structure of an embodiment of a management device for private server dependent source code provided by the present application. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0056] In view of the problem that the existing way of directly accessing external third-party class libraries cannot safely obtain third-party dependent source code, uniformly manage internal dependent source code and third-party dependent source code, a method for managing private service dependent source code is provided in the embodiments of the present application. Although the present application provides method operation steps or device structures as shown in the following embodiments or drawings, more or fewer operation steps or module units may be included in the method or device based on routine or no creative labor. In the steps or structures where there is no necessary causal relationship logically, the execution order of these steps or the module structure of the device is not limited to the execution order or module structure described in the embodiments of the present application and shown in the drawings. When the method or module structure is applied in an actual device or terminal product, it can be connected according to the method or module structure shown in the embodiments or drawings for sequential execution or parallel execution (for example, a parallel processor or a multi-threaded processing environment, or even a distributed processing environment).
[0057] Specifically, Figure 1As shown, the above-mentioned private server dependent source code management method may include the following steps:
[0058] S101: Create a private server dependent source code repository of the target source code management system.
[0059] Specifically, the private service dependency source code warehouse may be a CocoaPods private service warehouse built on an intranet.
[0060] S102: Obtain an index file of third-party dependent code from a target source code management system.
[0061] Specifically, the index file of the third-party dependent code includes detailed information of the third-party dependent code, such as the author, version and address of the third-party dependent code.
[0062] S103: Building a target code project according to the index file of the third-party dependent code.
[0063] Specifically, through the index file of the third-party dependent code, a target code project can be created to store the index file of the third-party dependent code. The target code project can be created on GitHub, and the GitHub is deployed in the proxy server.
[0064] S104: uploading the external dependency index source code to the private server dependency source code warehouse according to the address of the target code project.
[0065] Specifically, after obtaining the address of the target code project, the target code project can be uploaded to the private server dependency source code repository through the github synchronization tool according to the address of the target code project. Uploading the target code project is to upload the external dependency index source code.
[0066] S105: Acquire the address of the third-party dependency source code according to the external dependency index source code.
[0067] Specifically, after the external dependency index source code is successfully synchronized, the external dependency index source code can be added to a compilation and packaging module, and then the compilation and packaging module searches for the third-party dependency source code required in the project according to the external dependency index source code to obtain the address of the third-party dependency source code.
[0068] S106: Uploading the third-party dependency source code to the private server dependency source code warehouse according to the address of the third-party dependency source code.
[0069] Specifically, the third-party dependency source code can be uploaded to the private server dependency source code warehouse through the GitHub synchronization tool.
[0070] S107: Create an index file of the private dependency code of the target source code management system.
[0071] Specifically, an index file of the private dependency code may be created according to the private dependency source code project and the private index source code project, wherein the index file of the private dependency code describes detailed information of the private dependency source code, such as name, version, dependency, etc.
[0072] S108: Uploading the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code.
[0073] Specifically, before uploading the private index source code and the private dependency source code, it is necessary to first verify the index file of the private dependency code. If the index file of the private dependency code is valid, upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code, including: verifying the validity of the index file of the private dependency code; if the index file of the private dependency code is valid, determining the name of the private server dependency source code warehouse and the upload path of the index file of the private dependency code; uploading the private index source code and the private dependency source code to the private server dependency source code warehouse according to the name of the private server dependency source code warehouse and the upload path of the index file of the private dependency code.
[0074] Furthermore, after verifying the validity of the index file of the private dependent code, it also includes: when the index file of the private dependent code is invalid, determining the problem type of the index file of the private dependent code and the location where the problem occurs based on the error information in the verification result; correcting the problem based on the problem type and the location where the problem occurs; and verifying the validity of the index file of the private dependent code again until the verification passes.
[0075] S109: calling the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and calling the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse.
[0076] In order to ensure that only authorized users can access, upload and download third-party dependent source code and private dependent source code in the private server dependent source code repository, permission control can be configured for the private source code repository. Specifically, user access rights and audit logs of the private server dependent source code repository can be configured, wherein different users are configured with different access rights to the private server dependent source code repository, and then permission control is performed on user access based on the user access rights and audit logs. This access control mechanism can protect the data security of the private dependent source code repository and prevent access and malicious attacks by unauthorized users.
[0077] Furthermore, according to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called, including: obtaining the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; according to the address of the external dependency index source code, obtaining the corresponding third-party dependency source code; according to the address of the private index source code, obtaining the corresponding private dependency source code; installing and compiling and packaging the obtained third-party dependency source code and / or private dependency source code.
[0078] The above method is described below in conjunction with a specific embodiment. However, it should be noted that this specific embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0079] In this embodiment, considering that the existing method of directly accessing external third-party class libraries has the problem of being unable to securely obtain third-party dependent source code and uniformly manage internal dependent source code and third-party dependent source code, the third-party dependent source code and private dependent source code are uniformly uploaded to the private service dependent source code warehouse on the intranet, and the third-party dependent source code and private dependent source code are uniformly managed. The private service dependent source code warehouse is configured with access control to ensure that only authorized users can access, upload and download the dependent source code in the warehouse, prevent unauthorized users from accessing and malicious attacks, and configure the access rights and audit log functions of the private service dependent source code warehouse to achieve monitoring and tracing of user behavior, thereby ensuring the safe and stable operation of the private service dependent source code warehouse.
[0080] This embodiment manages private server dependency source code in an intranet environment, including synchronizing external dependency index source code and external third-party dependency source code resources, uploading private dependency source code to a private server dependency source code warehouse, and how to install and use third-party dependency source code and private dependency source code resources during compilation and packaging.
[0081] S1: Synchronize external dependency index source code and third-party dependency source code resources.
[0082] First, the private server creates a target code project with the source code repository to store index files of all third-party dependent code projects that can be managed using the private server dependent source code repository. The index file contains detailed information about the third-party dependent code, such as author, version, address, etc.
[0083] Synchronizing the external dependency index source code is to synchronize the target code project, which specifically includes: copying the address of the target code project, synchronizing the target code repository to the intranet private server dependency source code repository through the GitHub synchronization tool, where the GitHub synchronization tool is deployed on a proxy server and can access external resources through GitHub, which is used to synchronize external resources to the intranet private server dependency source code repository.
[0084] After the external dependency index source code is successfully synchronized, add the external dependency index source code to the development team's compilation and packaging computer, search for the third-party dependency source code required in the project, get the address of the third-party dependency source code on GitHub, and then use the GitHub synchronization tool to synchronize the third-party dependency source code to the intranet private server dependency source code repository.
[0085] S2: Private dependency source code is uploaded to the private server dependency source code repository.
[0086] First, create an index file based on the private index source code project and the private dependency source code project. This file describes the detailed information of the dependency source code, such as name, version, dependency, etc. Then determine the name of the private server dependency source code repository and the path of the index file, and upload the private index source code and private dependency source code to the private server dependency source code repository through the index file.
[0087] Before uploading private index source code and private dependency source code, you can first verify whether the index file is valid. Specifically, you can first check whether there are syntax errors in the index file. Then, according to the dependencies in the index file, find the corresponding version of the remote repository and copy it to the local for configuration. Finally, try to compile the private dependency source code to ensure that all codes can be compiled successfully.
[0088] Furthermore, in the case where the index file verification is invalid, the cause of the problem is determined based on the error information in the verification result, and the problem is corrected, and the corrected index file is checked again until all checks pass.
[0089] S3: Install and use the dependent source code in the private server dependency source code repository.
[0090] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; obtain the corresponding third-party dependency source code according to the address of the external dependency index source code; obtain the corresponding private dependency source code according to the address of the private index source code; install and compile and package the obtained third-party dependency source code and / or private dependency source code. Specifically, Xcode or Devops pipeline can be used for compilation and packaging.
[0091] The management method of the private server dependency source code is described as follows using a specific example:
[0092] Specifically, Figure 2 As shown, this embodiment uses the CocoaPods dependency management tool in an intranet environment, including synchronizing the external dependency index specs source code and external third-party dependency source code resources, uploading the dependency source code produced by the internal development team to the CocoaPods private server, and how to install and use the dependency source code resources when compiling and packaging iOS projects.
[0093] The dependencies managed by CocoaPods include two parts: one is the index library, which can be understood as the directory of a book, saving the address of the dependent library resources; the other is the dependent library resources themselves, which include the source code, resource files and configuration files of the library. The intranet CocoaPods private server needs to cache both the index library and the dependent library resources.
[0094] S1: Synchronize external dependency index source code and third-party dependency source code resources.
[0095] The external dependency index source code is a specs code project created by CocoaPods on github, which is used to store podspec files of all third-party dependency code projects that can be managed by CocoaPods. The podspec file contains detailed information about the third-party dependency code, such as author, version, address, etc. Synchronizing the external dependency index source code is to synchronize this specs code project. First copy the address of the specs code project, and then use the github synchronization tool to synchronize the specs code project to the intranet CocoaPods private server. The github synchronization tool is deployed on a proxy server, and external resources can be accessed through the github synchronization tool to synchronize external resources to the intranet CocoaPods private server.
[0096] After the external dependency index source code is successfully synchronized, use the pod repo add command to add the index source code to the development team's compilation and packaging computer, use the pod search command to search for the third-party dependency source code required in the project, get the address of the dependency source code on GitHub, and continue to use the GitHub synchronization tool to synchronize the dependency source code to the intranet CocoaPods private server.
[0097] S2: The dependency source code produced by the internal development team is uploaded to the CocoaPods private server.
[0098] First, upload the internal private specs index source code to the CocoaPods private server, and then prepare the .podspec file, which describes the detailed information of the dependent source code, such as name, version, dependency, etc. Then use the pod repo push command to specify the name of the private server repository and the path of the .podspec file to upload the dependent source code to the CocoaPods private server.
[0099] Before uploading the dependent source code, you can use the pod spec lint command to verify whether the .podspec file is valid to detect and correct possible problems in advance.
[0100] For the index file, running the pod spec lint command will perform a series of checks:
[0101] First, it checks whether there are any syntax errors in the .podspec file. Then, based on the dependencies in the podspec file, it finds the corresponding version of the remote repository and copies it to the local repository for configuration. Finally, it tries to compile the dependent source code of the project to ensure that all the code can be compiled successfully.
[0102] If a problem is found during the check, pod spec lint will output detailed error information, which shows what the problem is, such as incorrect dependencies, source code that cannot be compiled, etc. Suppose there is a dependency in the .podspec file that is written incorrectly, such as spec.dependency'WrongDependency','~>1.0', but it should actually be an existing library CorrectDependency. Then, after running pod spec lintMyLibrary.podspec, you will see an error message similar to the following:
[0103] ERROR|[MyLibrary / Dependencies]Unable to find a specification for`WrongDependency`(~>1.0)
[0104] At this point, you know that the dependencies are incorrect and need to be modified to the correct dependencies, and then run pod spec lint again for testing until all checks pass.
[0105] S3: How to install and use dependent source code resources.
[0106] First, in the Podfile file of the project that needs to be compiled and packaged, specify the private service index source code address, including the external index source code address synchronized in the first step and the internal private index source code address in the second step. Then, execute the podinstall command to install the dependent source code stated in the Podfile. Finally, use the xcode on the development team's computer to compile and package, or directly use the Devops pipeline to compile and package.
[0107] In the above embodiment, the third-party dependent source code and the private dependent source code are uniformly uploaded to the private service dependent source code warehouse of the intranet, the third-party dependent source code and the private dependent source code are uniformly managed, and access control is configured for the private service dependent source code warehouse to ensure that only authorized users can access, upload and download the dependent source code in the warehouse, prevent access and malicious attacks by unauthorized users, and configure the access rights and audit log functions of the private service dependent source code warehouse to achieve monitoring and tracing of user behavior, thereby ensuring the safe and stable operation of the private service dependent source code warehouse.
[0108] The method embodiments provided in the above embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on an electronic device as an example, Figure 3 This is a hardware structure block diagram of an electronic device for a private server-dependent source code management method provided by this application. Figure 3 As shown, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (the processor 02 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 04 for storing data, and a transmission module 06 for communication functions. It can be understood by those skilled in the art that Figure 3 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown.
[0109] The memory 04 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the management method of the private service dependency source code in the embodiment of the present application. The processor 02 executes various functional applications and data processing by running the software programs and modules stored in the memory 04, that is, the management method of the private service dependency source code of the above-mentioned application program is realized. The memory 04 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 04 may further include a memory remotely arranged relative to the processor 02, and these remote memories may be connected to the electronic device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0110] The transmission module 06 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the electronic device 10. In one example, the transmission module 06 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 06 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0111] At the software level, the management device of the private server relying on source code can be as follows Figure 4 As shown, including:
[0112] The first creation module 401 is used to create a private server dependent source code repository of the target source code management system;
[0113] A first acquisition module 402 is used to acquire an index file of third-party dependent code of a target source code management system;
[0114] The second creation module 403 is used to construct a target code project according to the index file of the third-party dependent code;
[0115] A first uploading module 404 is used to upload the external dependency index source code to the private server dependency source code warehouse according to the address of the target code project;
[0116] The second acquisition module 405 is used to acquire the address of the third-party dependency source code according to the external dependency index source code;
[0117] The second uploading module 406 is used to upload the third-party dependent source code to the private server dependent source code warehouse according to the address of the third-party dependent source code;
[0118] The third creation module 407 is used to create an index file of the private dependency code of the target source code management system;
[0119] The third uploading module 408 is used to upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code;
[0120] The calling module 409 is used to call the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and to call the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse.
[0121] In one embodiment, the third uploading module 408 uploads the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code, including:
[0122] Verifying the validity of the index file of the private dependency code;
[0123] If the index file of the private dependency code is valid, determine the name of the private service dependency source code warehouse and the upload path of the index file of the private dependency code;
[0124] According to the name of the private server dependency source code warehouse and the upload path of the index file of the private dependency code, the private index source code and the private dependency source code are uploaded to the private server dependency source code warehouse.
[0125] In one embodiment, verifying the validity of the index file of the private dependency code includes:
[0126] Check whether the index file of the private dependency code has syntax errors;
[0127] Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.
[0128] In one embodiment, after verifying the validity of the index file of the private dependency code, the method further includes:
[0129] In the case where the index file of the private dependent code is invalid, determining the problem type of the index file of the private dependent code and the location where the problem occurs according to the error information in the verification result;
[0130] Correct the problem according to the type of problem and the location where the problem occurs;
[0131] The validity of the index file of the private dependency code is verified again until the verification passes.
[0132] In one embodiment, before the calling module 409 calls the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and calls the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse, it also includes:
[0133] Configuring user access rights and audit logs for the private server dependent source code warehouse, wherein different users are configured with different access rights to the private server dependent source code warehouse;
[0134] The user's access is controlled based on the user's access rights and audit logs.
[0135] In one embodiment, the calling module 409 calls the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and calls the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse, including:
[0136] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code;
[0137] According to the address of the external dependency index source code, obtain the corresponding third-party dependency source code;
[0138] According to the address of the private index source code, obtain the corresponding private dependency source code;
[0139] Install, compile and package the acquired third-party dependency source code and / or private dependency source code.
[0140] The embodiment of the present application also provides a specific implementation of an electronic device capable of implementing all the steps in the private server dependent source code management method in the above embodiment, and the electronic device specifically includes the following contents: a processor, a memory, a communication interface and a bus; wherein the processor, the memory and the communication interface communicate with each other through the bus; the processor is used to call the computer program in the memory, and when the processor executes the computer program, all the steps in the private server dependent source code management method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0141] Step 1: Create a private server dependent source code repository for the target source code management system;
[0142] Step 2: Get the index file of the third-party dependent code of the target source code management system;
[0143] Step 3: Build a target code project according to the index file of the third-party dependent code;
[0144] Step 4: According to the address of the target code project, upload the external dependency index source code to the private server dependency source code warehouse;
[0145] Step 5: Obtain the address of the third-party dependency source code according to the external dependency index source code;
[0146] Step 6: According to the address of the third-party dependent source code, upload the third-party dependent source code to the private server dependent source code warehouse;
[0147] Step 7: Create an index file of the private dependency code of the target source code management system;
[0148] Step 8: Upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code;
[0149] Step 9: According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called.
[0150] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method for managing private server-dependent source code in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the method for managing private server-dependent source code in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0151] Step 1: Create a private server dependent source code repository for the target source code management system;
[0152] Step 2: Get the index file of the third-party dependent code of the target source code management system;
[0153] Step 3: Build a target code project according to the index file of the third-party dependent code;
[0154] Step 4: According to the address of the target code project, upload the external dependency index source code to the private server dependency source code warehouse;
[0155] Step 5: Obtain the address of the third-party dependency source code according to the external dependency index source code;
[0156] Step 6: According to the address of the third-party dependent source code, upload the third-party dependent source code to the private server dependent source code warehouse;
[0157] Step 7: Create an index file of the private dependency code of the target source code management system;
[0158] Step 8: Upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code;
[0159] Step 9: According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called.
[0160] From the above description, it can be known that the embodiment of the present application creates a private service dependency source code warehouse of the target source code management system; obtains the index file of the third-party dependency code of the target source code management system; builds the target code project according to the index file of the third-party dependency code; uploads the external dependency index source code to the private service dependency source code warehouse according to the address of the target code project; obtains the address of the third-party dependency source code according to the external dependency index source code; uploads the third-party dependency source code to the private service dependency source code warehouse according to the address of the third-party dependency source code; creates an index file of the private dependency code of the target source code management system; uploads the private index source code and the private dependency source code to the private service dependency source code warehouse through the index file of the private dependency code; calls the third-party dependency source code in the private service dependency source code warehouse according to the external dependency index source code in the private service dependency source code warehouse, and calls the private service dependency source code in the private service dependency source code warehouse according to the private index source code in the private service dependency source code warehouse. Through the above scheme, third-party dependency source code and private dependency source code can be managed uniformly, thereby improving the development efficiency of the project team.
[0161] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0162] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0163] Although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0164] Although the present specification embodiment provides the method operation steps as described in the embodiment or flow chart, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way in the order of execution of many steps, and does not represent a unique execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel (such as a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment) according to the method shown in the embodiment or the accompanying drawings. The term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements.
[0165] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0167] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0168] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0169] The present specification embodiments may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0170] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0171] The above is only an example of the embodiment of the present specification and is not intended to limit the embodiment of the present specification. For those skilled in the art, the embodiment of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiment of the present specification shall be included in the scope of the claims of the embodiment of the present specification.
Claims
1. A method for managing private servers that rely on source code, characterized in that: include: Create a private server dependent source code repository for the target source code management system; Get the index file of the third-party dependent code of the target source code management system; Building a target code project according to the index file of the third-party dependent code; According to the address of the target code project, uploading the external dependency index source code to the private server dependency source code warehouse; According to the external dependency index source code, obtain the address of the third-party dependency source code; According to the address of the third-party dependent source code, uploading the third-party dependent source code to the private server dependent source code warehouse; Create an index file of the private dependency code of the target source code management system; Upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code; According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called.
2. The method according to claim 1, characterized in that Uploading the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code includes: Verifying the validity of the index file of the private dependency code; If the index file of the private dependency code is valid, determine the name of the private service dependency source code warehouse and the upload path of the index file of the private dependency code; According to the name of the private server dependency source code warehouse and the upload path of the index file of the private dependency code, the private index source code and the private dependency source code are uploaded to the private server dependency source code warehouse.
3. The method according to claim 2, characterized in that Verify the validity of the index file of the private dependency code, including: Check whether the index file of the private dependency code has syntax errors; Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.
4. The method according to claim 2, characterized in that: After verifying the validity of the index file of the private dependency code, it also includes: In the case where the index file of the private dependent code is invalid, determining the problem type of the index file of the private dependent code and the location where the problem occurs according to the error information in the verification result; Correct the problem according to the type of problem and the location where the problem occurs; The validity of the index file of the private dependency code is verified again until the verification passes.
5. The method according to claim 1, characterized in that According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and before the private server dependency source code in the private server dependency source code warehouse is called according to the private index source code in the private server dependency source code warehouse, the method further includes: Configuring user access rights and audit logs for the private server dependent source code warehouse, wherein different users are configured with different access rights to the private server dependent source code warehouse; The user's access is controlled based on the user's access rights and audit logs.
6. The method according to claim 5, characterized in that According to the external dependency index source code in the private server dependency source code warehouse, the third-party dependency source code in the private server dependency source code warehouse is called, and according to the private index source code in the private server dependency source code warehouse, the private server dependency source code in the private server dependency source code warehouse is called, including: Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; According to the address of the external dependency index source code, obtain the corresponding third-party dependency source code; According to the address of the private index source code, obtain the corresponding private dependency source code; Install, compile and package the acquired third-party dependency source code and / or private dependency source code.
7. A management device for private servers that rely on source code, characterized in that: include: The first creation module is used to create a private server dependent source code repository of the target source code management system; A first acquisition module is used to acquire an index file of third-party dependent code of a target source code management system; A second creation module is used to build a target code project according to the index file of the third-party dependent code; A first uploading module, used to upload the external dependency index source code to the private server dependency source code warehouse according to the address of the target code project; A second acquisition module is used to acquire the address of the third-party dependency source code according to the external dependency index source code; A second uploading module is used to upload the third-party dependent source code to the private server dependent source code warehouse according to the address of the third-party dependent source code; The third creation module is used to create an index file of the private dependency code of the target source code management system; A third uploading module is used to upload the private index source code and the private dependency source code to the private server dependency source code warehouse through the index file of the private dependency code; The calling module is used to call the third-party dependency source code in the private server dependency source code warehouse according to the external dependency index source code in the private server dependency source code warehouse, and to call the private server dependency source code in the private server dependency source code warehouse according to the private index source code in the private server dependency source code warehouse.
8. An electronic device comprising a processor and a memory for storing instructions executable by the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Code compiling method and device, electronic equipment and storage medium
CN114461217A
File acquisition method and device, electronic equipment and readable storage medium
CN116361242A
Dependence introduction method and device, medium and electronic equipment
CN116521175A
Dependence-based software builds
US20110239195A1