Automatic deployment method and device, electronic equipment and storage medium
By configuring the member roles and permissions of the automated configuration project in the version control software library and performing deployment tasks with the continuous integration/continuous delivery deployment tool, the lack of deployment code management in automated deployment is solved, and deployment efficiency and reliability is improved.
Patent Information
- Application Number
- CN202411792293.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the lack of management of deployment code during automated deployment process is caused by inefficiency and error proneness, making it difficult to meet the needs of rapid iteration and immediate availability.
Configure member roles and permissions by automated configuration projects based on version control software libraries, configure member roles and permissions, add deployment code to the project based on roles and permissions, and call the automation configuration tool to perform deployment tasks through the continuous integration/continuous delivery deployment tool.
It realizes effective management of deployment code, improves the efficiency and reliability of automated deployment, and ensures the accuracy and security of deployment tasks.
Smart Images

Figure CN119759366A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an automated deployment method, device, electronic device, and storage medium. Background Art
[0002] Automated deployment is an indispensable part of modern software development and operation. It uses automated tools and processes to efficiently and accurately deploy software applications or system configurations from the development environment to the test, pre-production and production environments. The rise of automated deployment is closely related to the software industry's demand for agile development, continuous integration and continuous deployment, which drives the pursuit of faster and more reliable deployment methods.
[0003] With the popularity of cloud computing and microservice architecture, the IT environment of enterprises has become increasingly complex, involving the management of hundreds of servers and frequent updates of applications. In this context, manual or semi-automatic deployment methods are not only inefficient, but also prone to errors, and it is difficult to meet the needs of rapid iteration and immediate availability. Therefore, automated deployment tools have become the mainstream choice for enterprise IT operations and maintenance. However, in the prior art, if there are errors in the automated deployment tool configuration files written by the operator, such as scripts, deployment codes, host lists, etc., and then the wrong configuration files are used for execution, it will cause abnormalities and other adverse effects on the application services on the controlled nodes. And if you want to restore to the previous normal version, you need to manually change the automated deployment tool configuration file and execute it again to restore, and this process often takes a long time.
[0004] Currently, no effective solution has been proposed to address the problem that the efficiency of automated deployment is affected by the lack of management of deployment codes during the automated deployment process in related technologies. Summary of the invention
[0005] The main purpose of this application is to provide an automated deployment method, device, electronic device and storage medium to solve the problem of lack of management of deployment code in the automated deployment process in related technologies, which affects the efficiency of automated deployment.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an automated deployment method is provided. The method includes: configuring the member roles and member permissions involved in the automated configuration project based on the automated configuration project on the version control software library of the first server; adding the deployment code to the automated configuration project based on the member roles and member permissions on the version control software library; sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0007] Furthermore, before adding the deployment code to the automation configuration project on the version control software library based on member roles and member permissions, the method also includes: sending the automation deployment task code to be changed to the client through the first server; receiving the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the changes and adjustments are made to the automation deployment task code to be changed on the local branch of the client, and the operations involved in the changes and adjustments include at least one of the following: adding, updating, and deleting.
[0008] Furthermore, adding the deployment code to the automation configuration project on the version control software library based on the member roles and member permissions includes: receiving the deployment code sent by the development role through the remote branch of the first server, wherein the development role belongs to the member role involved in the automation configuration project; detecting the audit result of the management role on the deployment code, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit permission to audit the deployment code; when the audit result indicates that the audit is passed, adding the deployment code on the remote branch to the version control software library.
[0009] Further, adding the deployment code to the automated configuration project on the version control software library based on the member role and the member permission includes: when the version control software library of the first server detects a request from the development role to merge the deployment code on the remote branch into the main branch, the version control software library verifies the member role of the development role through a member role verification mechanism; after detecting that the member role verification of the development role is passed, the version control software library verifies whether the member role of the development role has a first preset member permission through a member permission verification mechanism, wherein the first preset member permission is the permission to write deployment code for the deployment task; after detecting that the member permission verification of the development role is passed, the version control software library verifies the member role of the management role through a member role verification mechanism; after detecting that the member role verification of the management role is passed, the version control software library verifies whether the member role of the management role has a second preset member permission through a member permission verification mechanism, wherein the second preset member permission is the permission to review whether the deployment code on the remote branch can be merged into the main branch; when detecting that the member permission verification of the management role is passed and detecting that the review result of the management role on the deployment code indicates that the review is passed, the deployment code on the remote branch is added to the version control software library.
[0010] Furthermore, before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method includes: creating a target project in the continuous integration / continuous delivery deployment tool; for the target project, configuring global roles and project roles on the continuous integration / continuous delivery deployment tool, and defining the project permission ranges corresponding to the global roles and project roles, wherein the global role is a role with the third preset member permission of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member permission of the target project; and assigning roles to users of the continuous integration / continuous delivery deployment tool based on the global role and the project role.
[0011] Furthermore, after sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: when the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates a deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through the project member role verification mechanism; if the operator's role is a global role or a project role, the deployment request is passed; in response to the deployment request, the automated configuration tool on the second server is called to execute the deployment task corresponding to the deployment code, and the deployment task is automatically deployed to the target control node.
[0012] Furthermore, sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library includes: when the continuous integration / continuous delivery deployment tool detects an update of the deployment code through a change trigger of the version control software library, extracting the deployment code to the workspace of the continuous integration / continuous delivery deployment tool; testing the deployment code in the workspace to obtain a test result; if the test result indicates that the test passes, calling the automated configuration tool to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool, and automatically deploying the deployment task to the target control node.
[0013] Furthermore, before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: encrypting and storing the sensitive information of the automated configuration tool on the second server in the key management backend; if the automated configuration tool detects that the deployment code requires the use of sensitive information, obtaining the key of the sensitive information based on the plug-in, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; the key management backend receives the key, decrypts the encrypted sensitive information, and obtains the corresponding sensitive information; based on the deployment code and the sensitive information, the automated configuration tool executes the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an automated deployment device is provided. The device comprises: a first configuration unit, configured based on the automated configuration project on the version control software library of the first server, to configure the member roles and member permissions involved in the automated configuration project; an adding unit, configured to add the deployment code to the automated configuration project on the version control software library according to the member roles and member permissions; a first deployment unit, configured to send the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0015] Furthermore, the device also includes: a sending unit, which is used to send the automated deployment task code to be changed to the client through the first server before adding the deployment code to the automated configuration project on the version control software library based on member roles and member permissions; a receiving unit, which is used to receive the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the automated deployment task code to be changed is changed and adjusted on the local branch of the client, and the operations involved in the change and adjustment include at least one of the following: adding, updating, and deleting.
[0016] Furthermore, the adding unit includes: a receiving module, which is used to receive the deployment code sent by the development role through the remote branch of the first server, wherein the development role belongs to the member role involved in the automation configuration project; a detection module, which is used to detect the audit result of the management role on the deployment code, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit authority to audit the deployment code; an adding module, which is used to add the deployment code on the remote branch to the version control software library when the audit result indicates that the audit is passed.
[0017] Further, the adding unit includes: a first verification module, which is used for the version control software library of the first server to verify the member role of the development role through the member role verification mechanism when the version control software library detects the request of the development role to merge the deployment code on the remote branch into the main branch; a second verification module, which is used for the version control software library to verify whether the member role of the development role has the first preset member permission through the member permission verification mechanism after detecting that the member role verification of the development role has passed, wherein the first preset member permission is the permission to write deployment code for the deployment task; a third verification module, which is used for the version control software library to verify the member role of the management role through the member role verification mechanism after detecting that the member permission verification of the development role has passed; a fourth verification module, which is used for the version control software library to verify whether the member role of the management role has the second preset member permission through the member permission verification mechanism after detecting that the member role verification of the management role has passed, wherein the second preset member permission is the permission to review whether the deployment code on the remote branch can be merged into the main branch; a first deployment module, which is used for adding the deployment code on the remote branch to the version control software library when detecting that the member permission verification of the management role has passed and detecting that the review result of the management role on the deployment code indicates that the review has passed.
[0018] Furthermore, the device also includes: a creation unit, which is used to create a target project in the continuous integration / continuous delivery deployment tool before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library; a second configuration unit, which is used to configure global roles and project roles on the continuous integration / continuous delivery deployment tool for the target project, and define the project authority scope corresponding to the global role and the project role, wherein the global role is a role with the third preset member authority of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member authority of the target project; an allocation unit, which is used to assign roles to users of the continuous integration / continuous delivery deployment tool based on the global role and the project role.
[0019] Furthermore, the device also includes: a verification unit, which is used to send the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library. When the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates the deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through the project member role verification mechanism; a passing unit, which is used to pass the deployment request if the operator's role is a global role or a project role; a second deployment unit, which is used to respond to the deployment request, call the automated configuration tool on the second server to execute the deployment task corresponding to the deployment code, and automatically deploy the deployment task to the target control node.
[0020] Furthermore, the first deployment unit includes: an extraction module, which is used to extract the deployment code to the workspace of the continuous integration / continuous delivery deployment tool when the continuous integration / continuous delivery deployment tool detects an update of the deployment code through a change trigger of the version control software library; a testing module, which is used to test the deployment code in the workspace and obtain a test result; and a second deployment module, which is used to call the automation configuration tool to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool if the test result indicates that the test passes, and automatically deploy the deployment task to the target control node.
[0021] Furthermore, the device also includes: an encryption unit, which is used to encrypt and store the sensitive information of the automation configuration tool on the second server in the key management backend before sending the deployment code in the automation configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library; an acquisition unit, which is used to obtain the key of the sensitive information based on the plug-in if the automation configuration tool detects that the deployment code needs to use sensitive information, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; a decryption unit, which is used for the key management backend to receive the key and decrypt the encrypted sensitive information to obtain the corresponding sensitive information; a third deployment unit, which is used for the automation configuration tool to execute the deployment task corresponding to the deployment code based on the deployment code and the sensitive information, and automatically deploy the deployment task to the target control node.
[0022] According to another aspect of the present application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein when the program is executed, a device where the computer-readable storage medium is located is controlled to execute any one of the automated deployment methods.
[0023] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the automated deployment methods.
[0024] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, which implement the steps of any one of the above-mentioned automated deployment methods when executed by a processor.
[0025] In an embodiment of the present application, the member roles and member permissions involved in the automated configuration project are configured based on the automated configuration project on the version control software library of the first server; the deployment code is added to the automated configuration project based on the member roles and member permissions on the version control software library; the deployment code in the automated configuration project is sent to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node, thereby solving the problem of lack of management of deployment code in the automated deployment process in the related technology, which affects the efficiency of automated deployment. In the present application, the member roles and member permissions involved in the automated configuration project on the version control software library of the first server are configured, and the deployment code is added to the automated configuration project based on the configured member roles and member permissions, and the deployment code is sent to the continuous integration / continuous delivery deployment tool on the second server, and the continuous integration / continuous delivery deployment tool calls the automated configuration tool to execute the deployment task, and automatically deploys the deployment task to the target control node, thereby achieving the technical effect of improving the efficiency of automated deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0027] Figure 1 A hardware structure block diagram of a computer terminal for implementing an automated deployment method is shown;
[0028] Figure 2 is a flowchart of an automated deployment method provided according to an embodiment of the present application;
[0029] Figure 3 It is a flowchart of sending and returning the deployment code provided in an embodiment of the present application;
[0030] Figure 4This is a flowchart of reviewing and deploying code provided according to an embodiment of the present application;
[0031] Figure 5 is a flowchart of adding deployment code to an automated configuration project according to an embodiment of the present application;
[0032] Figure 6 It is a flowchart of role allocation for users of continuous integration / continuous delivery deployment tools provided according to an embodiment of the present application;
[0033] Figure 7 It is a flowchart of sending the deployment code to the continuous integration / continuous delivery deployment tool provided according to an embodiment of the present application;
[0034] Figure 8 This is a flowchart of encrypting, storing and decrypting sensitive information according to an embodiment of the present application;
[0035] Fig. 9 is a schematic diagram of an automated deployment device provided according to an embodiment of the present application;
[0036] Fig.10 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0040] Example 1
[0041] According to an embodiment of the present application, an embodiment of a method for automated deployment is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an automated deployment method. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0043] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0044] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the automated deployment method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned automated deployment method. The memory 104 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 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 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.
[0045] The transmission device 106 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 computer terminal 10. In one example, the transmission device 106 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 device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0046] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0047] Under the above operating environment, this application provides Figure 2 The automated deployment method shown. Figure 2 It is a flowchart of the automated deployment method according to Example 1 of the present application.
[0048] Step S201: Based on the automated configuration project on the version control software library of the first server, member roles and member permissions involved in the automated configuration project are configured.
[0049] Optionally, the above version control software library can be used for code version management, multi-person collaboration and conflict resolution, change review and approval, historical version rollback, etc. Code version management: The version control software library can record the version history of each change in the automated configuration project, including but not limited to the host list, configuration files, etc., which is particularly important for long-term maintenance. Multi-person collaboration and conflict resolution: In the scenario where multiple people jointly manage the automated deployment tool, the version control software library provides a collaboration platform. Through the branch mechanism, each developer is allowed to work independently on his own branch, avoiding conflicts that may be caused by directly modifying the main branch code. It also provides a merge request function for reviewing and integrating changes from different branches to ensure that the changes are properly approved before they are officially merged into the main branch. Change review and approval: All changes to the configuration of the automated deployment tool, whether it is addition, update or deletion, must be submitted through the version control software library and reviewed and approved by other members. This ensures the accuracy and security of any changes and avoids production environment problems caused by configuration errors. Historical version rollback: If the automated deployment tool has problems in the operation of the production environment, or needs to be restored to a previous stable state, the version control software library allows rolling back to a historical version.
[0050] For example, create a new project named ansible-deployment on the version control software library to store Ansible Playbooks and related configuration files. In the ansible-deployment project, you can add different member roles, such as developer, maintainer, and project manager. The project manager has the highest authority and can manage project settings, including member roles and permissions. The developer role can submit code to the remote branch, and the maintainer can approve the merge request to the main branch.
[0051] Step S202: Add the deployment code to the automation configuration project in the version control software library according to the member role and member authority.
[0052] Optionally, the above member roles can be project administrators, who have the highest member permissions of the project and can perform all operations, including deleting projects, setting access control, and managing permissions of other members. The member role can be maintainer, and the corresponding member permissions can be managing repositories, including branch protection, project settings, and member management. Maintainers can approve or reject merge requests from other members, manage branches and tags of the code repository, and conduct code reviews. The member role can be developer, and the corresponding member permissions can be pushing and deploying code to non-master branches, creating and submitting merge requests, but cannot directly change the master branch or project settings. The developer role can clone the project locally, edit and test the code, and then submit it to its own remote branch. The developer role can initiate merge requests to request that code changes be merged into the master branch, but this operation requires approval from the maintainer or administrator. The member role can be guest, and the corresponding member permissions can be viewing code and project documents, creating and commenting on issues, but cannot modify or submit code. Guests can view all content in the code repository, report problems or errors in the code, and leave comments in merge requests to provide feedback. Guests cannot directly modify code or create new files. Member roles can also be unauthorized, which means no permissions to access the code base. Unauthorized members cannot perform any operations on the project, and cannot view, edit, or submit code. This permission is usually used for people outside the project to prevent them from accessing sensitive information. Through this fine division of member roles and member permissions, it can ensure that project members can collaborate efficiently and ensure the integrity and security of the code during the development and maintenance of the automated configuration project.
[0053] Step S203, sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0054] Optionally, the deployment code is reviewed and approved and merged into the main branch, and the continuous integration / continuous delivery deployment tool automatically triggers the deployment process when it detects updates to the deployment code. For example, the continuous integration / continuous delivery deployment tool can define a script in the "ansible-deployment" project, which includes cloning code from the version control software library, executing automated tests, and calling automated configuration tools to perform deployment tasks. Deployment tasks can be updating applications, configuring infrastructure, or enforcing security policies.
[0055] In summary, through steps S201-S203, by configuring the member roles and member permissions involved in the automated configuration project on the version control software library of the first server, deployment code is added to the automated configuration project according to the configured member roles and member permissions, and the deployment code is sent to the continuous integration / continuous delivery deployment tool on the second server. The continuous integration / continuous delivery deployment tool calls the automated configuration tool to execute the deployment task, and automatically deploys the deployment task to the target control node, thereby achieving the technical effect of improving the efficiency of automated deployment.
[0056] In an optional embodiment, if Figure 3 As shown, before adding the deployment code to the automation configuration project based on the member role and member permission on the version control software library, the method also includes:
[0057] Step S301: Send the automated deployment task code to be changed to the client through the first server.
[0058] Optionally, the first server is a server where the version control software library is located. The automated deployment task to be changed may be application service deployment, configuration management, network settings, system installation and update, etc. Members of the automated configuration project can use the version control software library to pull the latest code from the automated configuration project on the first server to the local machine (i.e., the client).
[0059] Step S302, receiving the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the change and adjustment is made on the local branch of the client for the automated deployment task code to be changed, and the operations involved in the change and adjustment include at least one of the following: adding, updating, and deleting.
[0060] Optionally, after completing the local code changes, the development role needs to submit the code (that is, the deployment code mentioned above) back to the version control software library of the first server. In order to avoid problems that may arise from directly modifying the main branch, the development role can submit the deployment code to a dedicated remote branch that corresponds to the changes in their local branch. In this way, the deployment code is isolated from the main branch and can be reviewed and tested more safely. Members of the project select the automated deployment task code to be changed and perform change adjustment operations based on the corresponding member roles and member permissions. The change adjustment operations can be adding, updating, deleting, etc.
[0061] In summary, through the above technical solution, the development role pulls the code from the first server to the client for modification, and the remote branch of the first server receives the deployment code returned by the client. This step provides the basis for the management of the deployment code. The modified deployment code is pushed back to the first server, not directly to the main branch, but to a remote branch, which improves the security of automated deployment.
[0062] In an optional embodiment, if Figure 4 As shown in the figure, adding deployment code to the automated configuration project based on member roles and member permissions on the version control software repository includes:
[0063] Step S401: receiving a deployment code sent by a development role through a remote branch of a first server, wherein the development role belongs to a member role involved in an automated configuration project.
[0064] For example, member A is a developer with development permissions and is responsible for writing deployment code for automated deployment tasks. Member A edits the deployment code in the local environment (i.e., the client) and submits the deployment code to a remote branch named feature-jenkins-plugins on the version control software library. This step allows the updated deployment code to be isolated and reviewed before it is officially merged into the main branch.
[0065] Step S402 , detecting the audit result of the management role on the deployment code, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit authority to audit the deployment code.
[0066] For example, member B is a management role with member permissions to review and approve change requests submitted by development roles. Member B receives a merge request created by member A on the version control software repository, requesting to merge the feature-jenkins-plugins branch into the main branch of the project. Member B reviews the updated deployment code submitted by member A. Member B needs to review whether the deployment code can correctly complete the automated deployment task and whether the deployment code is compatible with the existing environment. If the change is reasonable, member B will approve the merge request; if there are questions or problems, member B will ask member A to make modifications.
[0067] Step S403: When the audit result indicates that the audit is passed, the deployment code on the remote branch is added to the version control software library.
[0068] For example, after member B's review, it is confirmed that there is no problem with the deployment code submitted by member A, and member B approves the merge request. At this point, all the changed deployment codes on the feature-jenkins-plugins branch will be automatically merged into the main branch and become part of the version control software library. This means that the new deployment code has officially become part of the automated deployment project and can be used for the next step of automated deployment and testing.
[0069] In summary, through the above steps, it is ensured that the updated deployment code of the automated configuration project is reviewed and approved before being introduced into the production environment, reducing the risk of production environment failure due to configuration errors, while improving the efficiency of team collaboration and code quality, thereby improving the efficiency of automated deployment.
[0070] In an optional embodiment, if Figure 5 As shown in the figure, adding deployment code to the automated configuration project based on member roles and member permissions on the version control software repository includes:
[0071] Step S501, when the version control software library of the first server detects a request from a development role to merge the deployment code on a remote branch into a main branch, the version control software library verifies the member role of the development role through a member role verification mechanism.
[0072] Optionally, the member role verification mechanism is a mechanism that ensures that team members perform operations according to their predefined roles in the version control software library. The operation mechanism of this member role verification mechanism can be as follows:
[0073] 1. Authentication: First, members need to log in to the version control software library through an authentication mechanism. This can be done by entering a username and password, or using a more secure two-factor authentication (such as SMS verification code, hardware token or biometric information, etc.).
[0074] 2. Role verification: After logging in, the member role of the currently logged in user is determined based on the preset team member list and role assignment rules. Member roles can be management roles, maintainers, developers, visitors, etc. Each member role has corresponding member permissions.
[0075] For example, suppose member A is a member of the development role, and member A wants to submit a new deployment code change to the remote branch of the project. Member A logs in to the version control software repository using his account and password. If the login is successful, the version control software repository assigns member A a member role based on the account information, such as "development role".
[0076] Step S502, after detecting that the member role verification of the development role has passed, the version control software library verifies through a member permission verification mechanism whether the member role of the development role has a first preset member permission, wherein the first preset member permission is the permission to write deployment code for the deployment task;
[0077] Optionally, the member permission verification mechanism can operate as follows:
[0078] 1. Permission check: When a member attempts to perform an operation, the version control software library will check whether the member's member role has the member permission to perform the operation, which is the first preset member permission mentioned above.
[0079] 2. Operation authorization: If the member's member role and member permissions are verified, the member can be authorized to perform the requested operation, such as pushing code, creating merge requests, reviewing code changes, etc. If the verification fails, the system will block the operation, usually displaying an error message informing the user that the user does not have member permissions to perform the operation.
[0080] 3. Audit log: Regardless of whether the operation is successful or not, the version control software library will record the member's operation, including the type, time, operator, and result of the operation. These records are essential for tracing problems and auditing member operations.
[0081] For example, member A is a member of the development role. Member A wants to submit a new deployment code to the remote branch of the project. The process of verifying whether member A has the member permission to submit a new deployment code to the remote branch of the project is as follows:
[0082] 1. Create a remote branch and push the code: After editing the deployment code locally, member A creates a new remote branch feature-new-playbook, and then pushes the local branch to the remote branch of the version control software library through the push command.
[0083] 2. Permission review: The version control software library will verify whether member A has the permission to push the deployment code of the local branch to the remote branch of the version control software library, which is the first preset member permission mentioned above.
[0084] 3. Operation authorization: If member A's member role and member permissions are verified, member A can be authorized to push the deployment code of the local branch to the remote branch of the version control software library. If the verification fails, the system will block the operation, usually displaying an error message to inform member A that he does not have member permissions to perform the operation.
[0085] 4. Audit records: Regardless of whether the verification is passed or not, the version control software library will record the relevant information of this verification.
[0086] Step S503: after detecting that the member authority verification of the development role is passed, the version control software library verifies the member role of the management role through the member role verification mechanism.
[0087] For example, member B is a member of the management role, and member B wants to review whether the deployment code submitted on the remote branch can be merged into the main branch. Member B uses his account and password to log in to the version control software library. If the login is successful, the version control software library will assign member B a member role based on the account information, such as "management role".
[0088] Step S504, after detecting that the member role verification of the management role has passed, the version control software library verifies through the member permission verification mechanism whether the member role of the management role has the second preset member permission, wherein the second preset member permission is the permission to review whether the deployed code on the remote branch can be merged into the main branch.
[0089] For example, member B is a member of the management role. Member B wants to review whether the deployment code submitted on the remote branch can be merged into the main branch. The following member permissions are verified:
[0090] 1. Permission review: The version control software library will verify whether member B has the permission to review the merge request, which is the second preset member permission mentioned above.
[0091] 2. Operation authorization: If member B's member permissions are verified, member B can be authorized to perform the operation of reviewing the merge request. If the verification fails, the system will block the operation, usually displaying an error message informing member B that he does not have member permissions to perform the operation.
[0092] 3. Audit records: Regardless of whether the application for reviewing the merge request is approved, the version control software library will record the relevant information of this review merge request.
[0093] Step S505, when it is detected that the member authority verification of the management role is passed, and it is detected that the audit result of the management role on the deployment code indicates that the audit is passed, the deployment code on the remote branch is added to the version control software library.
[0094] For example, member B carefully reviews the deployment code on the remote branch and confirms that the changes to the deployment code meet the project requirements and do not introduce security vulnerabilities or conflict with existing configurations. Member B approves the merge request, and the version control software library automatically merges all the changed deployment code on the remote branch into the main branch.
[0095] In summary, through the verification and review steps of the above technical solution, not only the accuracy of the deployed code is ensured, but also it is ensured that only project members with appropriate member roles and member permissions can modify the version control software library, thereby improving the reliability and security of automated deployment.
[0096] In an optional embodiment, if Figure 6 As shown, before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method includes:
[0097] Step S601, creating a target project in a continuous integration / continuous delivery deployment tool.
[0098] For example, member B created a project named "ansible-deployment-pipeline" on the continuous integration / continuous delivery deployment tool (the target project mentioned above).
[0099] Step S602: for the target project, configure global roles and project roles on the continuous integration / continuous delivery deployment tool, and define the project permission ranges corresponding to the global roles and project roles, wherein the global role is a role with the third preset member permission of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member permission of the target project.
[0100] For example, member B defines the global role "ansible-admin", and the third preset member permission is to have the member permission to create, delete and configure projects and manage the entire instance. Member B creates the project role "ansible-deployer", and the fourth preset member permission is to have the member permission to build and configure the "ansible-deployment-pipeline" project (the above target project), but does not include the permission to delete the project, which ensures that the deployer can perform the deployment task while also protecting the security of the target project.
[0101] Step S603: assign roles to users of the continuous integration / continuous delivery deployment tool based on global roles and project roles.
[0102] For example, member B assigns predefined roles to team members in the continuous integration / continuous delivery deployment tool. For example, member B assigns member C the "ansible-admin" global role, giving member C management rights over the entire continuous integration / continuous delivery deployment tool. For member D and member E, member B assigns them to the "ansible-deployer" project role, so that member D and member E can only build and configure the specific "ansible-deployment-pipeline" project and cannot affect other projects.
[0103] In summary, through the above technical solutions, the member roles and member permissions of the continuous integration / continuous delivery deployment tool are managed in a refined manner, ensuring that each member can perform corresponding operations according to their responsibilities, while also avoiding the risk of permission abuse or erroneous operations.
[0104] In an optional embodiment, after sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method further includes:
[0105] When the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates a deployment request, the continuous integration / continuous delivery deployment tool verifies the operator's role through the project member role verification mechanism;
[0106] If the operator's role is a global role or a project role, a deployment request is passed; in response to the deployment request, the automated configuration tool on the second server is called to execute the deployment task corresponding to the deployment code, and the deployment task is automatically deployed to the target control node.
[0107] Optionally, operators with global roles can perform operations in any project of the CI / CD deployment tool without having to set permissions in each project separately. Project roles more specifically control the permissions of operators in a specific project. Administrators set independent permissions for each project role to adapt to project-specific needs.
[0108] For example, after member A completes the update of the deployment code, he merges the changes into the main branch through the merge request process of the version control software library, and the continuous integration / continuous delivery deployment tool pulls the code from the version control software library. Member D initiates the deployment request, and the continuous integration / continuous delivery deployment tool checks the role of member D to confirm whether member D has a global role or a project role, because these roles include the role permission to start a build. If the verification passes, the continuous integration / continuous delivery deployment tool will extract the latest deployment code according to the pre-configured script, and call the automated configuration tool located on the second server to execute the deployment task corresponding to the deployment code, and automatically deploy the changes to the target control node.
[0109] In summary, the above member role verification mechanism not only ensures that only authorized operators can start the deployment process, but also achieves efficient and secure deployment of deployment code.
[0110] In an optional embodiment, if Figure 7 As shown, the continuous integration / continuous delivery deployment tool that sends the deployment code in the automated configuration project to the second server through the version control software library includes:
[0111] Step S701: When the continuous integration / continuous delivery deployment tool detects that the deployment code is updated through a change trigger of the version control software library, the deployment code is extracted to the workspace of the continuous integration / continuous delivery deployment tool.
[0112] Optionally, a change trigger is a monitoring mechanism that can be configured on a continuous integration / continuous delivery deployment tool or on a version control repository. A change trigger is used to monitor code changes in a version control repository. When new submissions or merge requests are accepted for code in the version control repository, the change trigger automatically detects these changes and automatically triggers workflows such as code building, testing, and deployment according to preset rules.
[0113] Step S702: Test the deployed code in the workspace to obtain a test result.
[0114] For example, continuous integration / continuous delivery deployment tools automatically execute predefined test scripts in the workspace. These test scripts can be unit tests, integration tests, security scans, code quality checks, etc. The test scripts check whether the newly changed deployment code introduces errors or potential security issues. After the test is completed, the continuous integration / continuous delivery deployment tool will generate a test report showing the status of whether the test passed or failed.
[0115] Step S703: if the test result indicates that the test is passed, the automatic configuration tool is called to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool, and the deployment task is automatically deployed to the target control node.
[0116] For example, if the test results show that the newly changed deployment code does not introduce errors or security issues, the test results are marked as passed. At this point, the continuous integration / continuous delivery deployment tool will call the automation configuration tool according to the pre-configured execution strategy to deploy the deployment task to the target control node (such as the production server).
[0117] In summary, through the above technical solutions, continuous integration / continuous delivery deployment tools can automatically detect, test and deploy deployment codes in automated configuration projects, improving the efficiency and quality of automated deployment while reducing the risks of the production environment.
[0118] In an optional embodiment, if Figure 8 As shown, before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes:
[0119] Step S801: encrypt and store the sensitive information of the automated configuration tool on the second server in a key management backend.
[0120] Optionally, the sensitive information of the above automated configuration tools can be confidential or private data that needs to be processed during configuration management, application deployment, and system maintenance. If such sensitive information is leaked, it may have a serious impact on system security, data security, or business operations. Proper management and use of such sensitive information is a key link in automated deployment and operation and maintenance, and is essential for protecting corporate assets, preventing data leakage, and ensuring system stability.
[0121] For example, sensitive information such as database connection strings, private API keys, or SSH keys are required in the deployment code. These sensitive information cannot be written directly into the code base to avoid leakage. First, encrypt these sensitive information and store them in the key management backend. When storing sensitive information in the key management backend, a specific path or key ID is generated for each sensitive information so that it can be accessed during the deployment process.
[0122] Step S802: If the automated configuration tool detects that the deployment code requires the use of sensitive information, the key for the sensitive information is obtained based on the plug-in, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend.
[0123] For example, when the automated configuration tool detects that the deployed code needs to use sensitive information, it calls the plug-in of the key management backend and passes a specific key ID to request decryption of the sensitive information.
[0124] Step S803: The key management backend receives the key and decrypts the encrypted sensitive information to obtain the corresponding sensitive information.
[0125] For example, when the key management backend receives a request to decrypt encrypted sensitive information and the correct key ID, it verifies the source of the request and the validity of the key ID. Once the verification is successful, the key management backend will decrypt the sensitive information using the key ID and return it to the requesting automated configuration tool. In this way, sensitive information is only decrypted when needed and can only be accessed by authorized applications.
[0126] Step S804: Based on the deployment code and the sensitive information, the automated configuration tool executes the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0127] For example, the deployment code and sensitive information obtained from the key management backend are used as input to call the automated configuration tool to execute the deployment code. The automated configuration tool uses this sensitive information, such as database connection strings, to configure or update applications and services on the target control node (such as a production server). Since sensitive information is dynamically decrypted during the deployment process, this ensures that even if the automated configuration tool is misoperated or improperly accessed, the sensitive information remains secure.
[0128] In summary, through the above technical solutions, the safe management and use of sensitive information of automated configuration projects in the automated deployment process are realized, ensuring the security of sensitive information while maintaining the efficiency and flexibility of automated deployment.
[0129] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0130] Example 2
[0131] The embodiment of the present application also provides an automatic deployment device. It should be noted that the automatic deployment device of the embodiment of the present application can be used to execute the automatic deployment method provided by the embodiment of the present application. The automatic deployment device provided by the embodiment of the present application is introduced below.
[0132] According to an embodiment of the present application, a device for implementing the above-mentioned automated deployment method is also provided, such as Fig. 9As shown, the device includes: a first configuration unit 901, an adding unit 902 and a first deployment unit 903.
[0133] Specifically, the first configuration unit 901 is used to configure the member roles and member permissions involved in the automation configuration project based on the automation configuration project on the version control software library of the first server; the adding unit 902 is used to add the deployment code to the automation configuration project based on the member roles and member permissions on the version control software library; the first deployment unit 903 is used to send the deployment code in the automation configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automation configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0134] The automated deployment device provided in the embodiment of the present application configures the member roles and member permissions involved in the automated configuration project based on the automated configuration project on the version control software library of the first server through the first configuration unit 901; the adding unit 902 adds the deployment code to the automated configuration project based on the member roles and member permissions on the version control software library; the first deployment unit 903 sends the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node, thereby solving the problem of lack of management of deployment code in the automated deployment process in the related technology, which affects the efficiency of automated deployment. In the present application, the member roles and member permissions involved in the automated configuration project on the version control software library of the first server are configured, and the deployment code is added to the automated configuration project based on the configured member roles and member permissions, and the deployment code is sent to the continuous integration / continuous delivery deployment tool on the second server, and the continuous integration / continuous delivery deployment tool calls the automated configuration tool to execute the deployment task, and automatically deploys the deployment task to the target control node, thereby achieving the technical effect of improving the efficiency of automated deployment.
[0135] Optionally, the device also includes: a sending unit, used to send the automated deployment task code to be changed to the client through the first server before adding the deployment code to the automated configuration project on the version control software library based on member roles and member permissions; a receiving unit, used to receive the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the automated deployment task code to be changed is changed and adjusted on the local branch of the client, and the operations involved in the change and adjustment include at least one of the following: adding, updating, and deleting.
[0136] Optionally, the adding unit 902 includes: a receiving module, used to receive the deployment code sent by the development role through the remote branch of the first server, wherein the development role belongs to the member role involved in the automation configuration project; a detection module, used to detect the audit result of the management role on the deployment code, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit authority to audit the deployment code; an adding module, used to add the deployment code on the remote branch to the version control software library when the audit result indicates that the audit is passed.
[0137] Optionally, the adding unit 902 includes: a first verification module, which is used to verify the member role of the development role through a member role verification mechanism when the version control software library of the first server detects a request from the development role to merge the deployment code on the remote branch into the main branch; the first verification module is used to verify whether the member role of the development role has a first preset member permission through a member permission verification mechanism after detecting that the member role verification of the development role has passed, wherein the first preset member permission is the permission to write deployment code for the deployment task; a third verification module is used to verify the member role of the management role through a member role verification mechanism after detecting that the member permission verification of the development role has passed; a fourth verification module is used to verify whether the member role of the management role has a second preset member permission through a member permission verification mechanism after detecting that the member role verification of the management role has passed, wherein the second preset member permission is the permission to review whether the deployment code on the remote branch can be merged into the main branch; a first deployment module is used to add the deployment code on the remote branch to the version control software library when detecting that the member permission verification of the management role has passed and detecting that the review result of the management role on the deployment code indicates that the review has passed.
[0138] Optionally, the device includes: a creation unit, used to create a target project in the continuous integration / continuous delivery deployment tool before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library; a second configuration unit, used to configure global roles and project roles on the continuous integration / continuous delivery deployment tool for the target project, and define the project authority scope corresponding to the global role and the project role, wherein the global role is a role with the third preset member authority of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member authority of the target project; an allocation unit, used to assign roles to users of the continuous integration / continuous delivery deployment tool based on the global role and the project role.
[0139] Optionally, the device also includes: a verification unit, which is used to send the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library. When the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates the deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through the project member role verification mechanism; a passing unit, which is used to pass the deployment request if the operator's role is a global role or a project role; a second deployment unit, which is used to respond to the deployment request, call the automated configuration tool on the second server to execute the deployment task corresponding to the deployment code, and automatically deploy the deployment task to the target control node.
[0140] Optionally, the first deployment unit 903 includes: an extraction module, which is used to extract the deployment code to the workspace of the continuous integration / continuous delivery deployment tool when the continuous integration / continuous delivery deployment tool detects an update of the deployment code through a change trigger of the version control software library; a testing module, which is used to test the deployment code in the workspace and obtain a test result; and a second deployment module, which is used to call the automation configuration tool to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool if the test result indicates that the test passes, and automatically deploy the deployment task to the target control node.
[0141] Optionally, the device also includes: an encryption unit, which is used to encrypt and store sensitive information of the automation configuration tool on the second server in a key management backend before sending the deployment code in the automation configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library; an acquisition unit, which is used to obtain a key for the sensitive information based on a plug-in if the automation configuration tool detects that the deployment code needs to use sensitive information, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; a decryption unit, which is used for the key management backend to receive the key and decrypt the encrypted sensitive information to obtain the corresponding sensitive information; a third deployment unit, which is used for the automation configuration tool to execute the deployment task corresponding to the deployment code based on the deployment code and the sensitive information, and automatically deploy the deployment task to the target control node.
[0142] It should be noted that the above-mentioned first configuration unit 901, adding unit 902, and first deployment unit 903 correspond to steps S201 to S203 in Example 1, and the three units and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0143] Example 3
[0144] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal or an electronic device.
[0145] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0146] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the automated deployment method: based on the automated configuration project on the version control software library of the first server, configure the member roles and member permissions involved in the automated configuration project; add the deployment code to the automated configuration project based on the member roles and member permissions on the version control software library; send the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0147] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the automated deployment method: before adding the deployment code to the automated configuration project on the version control software library based on member roles and member permissions, the method also includes: sending the automated deployment task code to be changed to the client through the first server; receiving the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the changes and adjustments are made to the automated deployment task code to be changed on the local branch of the client, and the operations involved in the changes and adjustments include at least one of the following: adding, updating, and deleting.
[0148] Optionally, the computer terminal may execute the program code of the following steps in the automated deployment method: adding the deployment code to the automated configuration project based on the member roles and member permissions on the version control software library includes: receiving the deployment code sent by the development role through the remote branch of the first server, wherein the development role is a member role involved in the automated configuration project; detecting the audit result of the management role on the deployment code, wherein the management role is a member role involved in the automated configuration project, and the management role has the audit permission to audit the deployment code; when the audit result indicates that the audit is passed, adding the deployment code on the remote branch to the version control software library.
[0149] Optionally, the computer terminal can execute the following steps in the automated deployment method: adding the deployment code to the automated configuration project based on the member role and member permission on the version control software library includes: when the version control software library of the first server detects a request from the development role to merge the deployment code on the remote branch into the main branch, the version control software library verifies the member role of the development role through a member role verification mechanism; after detecting that the member role verification of the development role has passed, the version control software library verifies whether the member role of the development role has a first preset member permission through a member permission verification mechanism, wherein the first preset member permission is for the deployment task. The permission to write deployment code; after detecting that the member permission verification of the development role has passed, the version control software library verifies the member role of the management role through the member role verification mechanism; after detecting that the member role verification of the management role has passed, the version control software library verifies whether the member role of the management role has the second preset member permission through the member permission verification mechanism, wherein the second preset member permission is the permission to review whether the deployment code on the remote branch can be merged into the main branch; when it is detected that the member permission verification of the management role has passed, and it is detected that the review result of the management role on the deployment code indicates that the review has passed, the deployment code on the remote branch is added to the version control software library.
[0150] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the automated deployment method: before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method includes: creating a target project in the continuous integration / continuous delivery deployment tool; for the target project, configuring global roles and project roles on the continuous integration / continuous delivery deployment tool, and defining the project authority scope corresponding to the global role and the project role, wherein the global role is a role with the third preset member authority of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member authority of the target project; and assigning roles to users of the continuous integration / continuous delivery deployment tool based on the global role and the project role.
[0151] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the automated deployment method: after sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: when the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates a deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through the project member role verification mechanism; if the operator's role is a global role or a project role, the deployment request is passed; in response to the deployment request, the automated configuration tool on the second server is called to execute the deployment task corresponding to the deployment code, and the deployment task is automatically deployed to the target control node.
[0152] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the automated deployment method: before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: encrypting and storing the sensitive information of the automated configuration tool on the second server in the key management backend; if the automated configuration tool detects that the deployment code needs to use sensitive information, obtaining the key of the sensitive information based on the plug-in, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; the key management backend receives the key, decrypts the encrypted sensitive information, and obtains the corresponding sensitive information; based on the deployment code and the sensitive information, the automated configuration tool executes the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0153] Optionally, Fig.10 is a structural block diagram of an electronic device according to an embodiment of the present application. Fig.10 As shown, the electronic device may include: one or more ( Fig.10 (only one is shown) processor 1002, memory 1004, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0154] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the automated deployment method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned automated deployment method. The memory 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 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal 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.
[0155] The processor can call the information and application programs stored in the memory through the transmission device to execute the above steps in the above automatic deployment method.
[0156] By adopting the embodiment of the present application, a scheme for automated deployment is provided. By configuring the member roles and member permissions involved in the automated configuration project based on the automated configuration project on the version control software library of the first server; adding the deployment code to the automated configuration project based on the member roles and member permissions on the version control software library; sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node, solving the problem of lack of management of deployment code in the automated deployment process in the related technology, affecting the efficiency of automated deployment. In the present application, the member roles and member permissions involved in the automated configuration project on the version control software library of the first server are configured, and the deployment code is added to the automated configuration project based on the configured member roles and member permissions, and the deployment code is sent to the continuous integration / continuous delivery deployment tool on the second server, and the continuous integration / continuous delivery deployment tool calls the automated configuration tool to execute the deployment task, and automatically deploys the deployment task to the target control node, thereby achieving the technical effect of improving the efficiency of automated deployment.
[0157] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.10 The structure of the electronic device is not limited. Fig.10More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.10 Different configurations are shown.
[0158] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0159] Example 4
[0160] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the automatic deployment method provided in the first embodiment.
[0161] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0162] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: based on the automation configuration project on the version control software library of the first server, configure the member roles and member permissions involved in the automation configuration project; add the deployment code to the automation configuration project based on the member roles and member permissions on the version control software library; send the deployment code in the automation configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automation configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0163] Optionally, the storage medium is also configured to store program code for executing the following steps: before adding the deployment code to the automation configuration project on the version control software library based on member roles and member permissions, the method also includes: sending the automation deployment task code to be changed to the client through the first server; receiving the deployment code returned by the client through the remote branch of the first server, wherein the deployment code is the code after the changes and adjustments are made to the automation deployment task code to be changed on the local branch of the client, and the operations involved in the changes and adjustments include at least one of the following: adding, updating, and deleting.
[0164] Optionally, the storage medium is also configured to store program code for executing the following steps: adding the deployment code to the automation configuration project based on the member roles and member permissions on the version control software library includes: receiving the deployment code sent by the development role through the remote branch of the first server, wherein the development role belongs to the member role involved in the automation configuration project; detecting the audit result of the management role on the deployment code, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit permission to audit the deployment code; when the audit result indicates that the audit is passed, adding the deployment code on the remote branch to the version control software library.
[0165] Optionally, the storage medium is also configured to store program code for executing the following steps: adding deployment code to an automated configuration project based on member roles and member permissions on a version control software library includes: when the version control software library of the first server detects a request from a development role to merge the deployment code on a remote branch into a main branch, the version control software library verifies the member role of the development role through a member role verification mechanism; after detecting that the member role verification of the development role has passed, the version control software library verifies whether the member role of the development role has a first preset member permission through a member permission verification mechanism, wherein the first preset member permission is to write a member permission for the deployment task. The permission to deploy code; after detecting that the member permission verification of the development role has passed, the version control software library verifies the member role of the management role through the member role verification mechanism; after detecting that the member role verification of the management role has passed, the version control software library verifies whether the member role of the management role has the second preset member permission through the member permission verification mechanism, wherein the second preset member permission is the permission to review whether the deployed code on the remote branch can be merged into the main branch; when it is detected that the member permission verification of the management role has passed, and it is detected that the audit result of the management role on the deployed code indicates that the audit has passed, the deployed code on the remote branch is added to the version control software library.
[0166] Optionally, the storage medium is also configured to store program code for executing the following steps: before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method includes: creating a target project in the continuous integration / continuous delivery deployment tool; for the target project, configuring global roles and project roles on the continuous integration / continuous delivery deployment tool, and defining the project authority scope corresponding to the global role and the project role, wherein the global role is a role with the third preset member authority of the entire continuous integration / continuous delivery deployment tool, and the project role is a role with the fourth preset member authority of the target project; and assigning roles to users of the continuous integration / continuous delivery deployment tool based on the global role and the project role.
[0167] Optionally, the storage medium is also configured to store program code for executing the following steps: after sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: when the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates a deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through the project member role verification mechanism; if the operator's role is a global role or a project role, the deployment request is passed; in response to the deployment request, the automated configuration tool on the second server is called to execute the deployment task corresponding to the deployment code, and the deployment task is automatically deployed to the target control node.
[0168] Optionally, the storage medium is also configured to store program code for executing the following steps: sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, including: when the continuous integration / continuous delivery deployment tool detects an update of the deployment code through a change trigger of the version control software library, extracting the deployment code to the workspace of the continuous integration / continuous delivery deployment tool; testing the deployment code in the workspace to obtain a test result; if the test result indicates that the test passes, calling the automated configuration tool to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool, and automatically deploying the deployment task to the target control node.
[0169] Optionally, the storage medium is also configured to store program code for executing the following steps: before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method also includes: encrypting and storing the sensitive information of the automated configuration tool on the second server in the key management backend; if the automated configuration tool detects that the deployment code requires the use of sensitive information, obtaining a key for the sensitive information based on the plug-in, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; the key management backend receives the key, decrypts the encrypted sensitive information, and obtains the corresponding sensitive information; based on the deployment code and the sensitive information, the automated configuration tool executes the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
[0170] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program of the automated deployment method steps.
[0171] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0172] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, 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 units or modules, which can be electrical or other forms.
[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0176] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0177] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An automated deployment method, characterized in that: include: Based on the automated configuration project on the version control software library of the first server, configure the member roles and member permissions involved in the automated configuration project; Adding deployment code to the automated configuration project on the version control software repository according to the member role and the member permission; The deployment code in the automated configuration project is sent to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server to execute the deployment task corresponding to the deployment code based on the deployment code, and automatically deploys the deployment task to the target control node.
2. The method according to claim 1, characterized in that: Before adding the deployment code to the automated configuration project on the version control software repository according to the member role and the member permission, the method further includes: Sending the automated deployment task code to be changed to the client through the first server; The deployment code returned by the client is received through the remote branch of the first server, wherein the deployment code is the code after the change and adjustment is made on the local branch of the client for the automated deployment task code to be changed, and the operations involved in the change and adjustment include at least one of the following: adding, updating, and deleting.
3. The method according to claim 1, characterized in that: Adding the deployment code to the automated configuration project on the version control software repository according to the member role and the member permission includes: Receiving, through a remote branch of the first server, a deployment code sent by a development role, wherein the development role belongs to a member role involved in the automated configuration project; Detecting the audit result of the deployment code by the management role, wherein the management role belongs to the member role involved in the automation configuration project, and the management role has the audit authority to audit the deployment code; When the audit result indicates that the audit is passed, the deployment code on the remote branch is added to the version control software library.
4. The method according to claim 3, characterized in that Adding the deployment code to the automated configuration project on the version control software repository according to the member role and the member permission includes: When the version control software library of the first server detects a request from the development role to merge the deployed code on the remote branch into the main branch, the version control software library verifies the member role of the development role through a member role verification mechanism; After detecting that the member role verification of the development role has passed, the version control software library verifies whether the member role of the development role has a first preset member permission through a member permission verification mechanism, wherein the first preset member permission is the permission to write deployment code for the deployment task; After detecting that the member authority verification of the development role is passed, the version control software library verifies the member role of the management role through a member role verification mechanism; After detecting that the member role verification of the management role has passed, the version control software library verifies whether the member role of the management role has a second preset member permission through a member permission verification mechanism, wherein the second preset member permission is the permission to review whether the deployed code on the remote branch can be merged into the main branch; When it is detected that the member authority verification of the management role is passed and when it is detected that the audit result of the management role on the deployment code indicates that the audit is passed, the deployment code on the remote branch is added to the version control software library.
5. The method according to claim 1, characterized in that Before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method includes: Create a target project in the continuous integration / continuous delivery deployment tool; For the target project, configure a global role and a project role on the continuous integration / continuous delivery deployment tool, and define the project permission ranges corresponding to the global role and the project role, wherein the global role is a role having the third preset member permission of the entire continuous integration / continuous delivery deployment tool, and the project role is a role having the fourth preset member permission of the target project; Roles are assigned to users of the continuous integration / continuous delivery deployment tool according to the global role and the project role.
6. The method according to claim 5, characterized in that After sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method further includes: When the continuous integration / continuous delivery deployment tool extracts the deployment code and detects that the operator initiates a deployment request, the continuous integration / continuous delivery deployment tool verifies the role of the operator through a project member role verification mechanism; If the role of the operator is the global role or the project role, the deployment request is approved; In response to the deployment request, the automated configuration tool on the second server is called to execute the deployment task corresponding to the deployment code, and the deployment task is automatically deployed to the target control node.
7. The method according to claim 1, characterized in that Sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library includes: When the continuous integration / continuous delivery deployment tool detects an update of the deployment code through a change trigger of a version control software library, extracting the deployment code into a workspace of the continuous integration / continuous delivery deployment tool; Testing the deployed code in the workspace to obtain a test result; If the test result indicates that the test is passed, the automated configuration tool is called to execute the deployment task through the execution configuration of the continuous integration / continuous delivery deployment tool, and the deployment task is automatically deployed to the target control node.
8. The method according to claim 1, characterized in that Before sending the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, the method further includes: Encrypting the sensitive information of the automated configuration tool on the second server and storing it in the key management backend; If the automated configuration tool detects that the deployment code needs to use the sensitive information, the key of the sensitive information is obtained based on the plug-in, wherein the key is used to decrypt the sensitive information encrypted and stored in the key management backend; The key management backend receives the key, decrypts the encrypted sensitive information, and obtains the corresponding sensitive information; Based on the deployment code and the sensitive information, the automated configuration tool executes the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
9. An automated deployment device, characterized in that: include: A first configuration unit is used to configure member roles and member permissions involved in the automated configuration project based on the automated configuration project on the version control software library of the first server; An adding unit, configured to add the deployment code to the automation configuration project on the version control software library according to the member role and the member permission; The first deployment unit is used to send the deployment code in the automated configuration project to the continuous integration / continuous delivery deployment tool on the second server through the version control software library, so that the continuous integration / continuous delivery deployment tool calls the automated configuration tool on the second server based on the deployment code to execute the deployment task corresponding to the deployment code, and automatically deploys the deployment task to the target control node.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the automated deployment method according to any one of claims 1 to 8.
11. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program executes the automated deployment method described in any one of claims 1 to 8 when running.
12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the automated deployment method described in any one of claims 1 to 8 are implemented.