Pipeline script configuration method and device, equipment and storage medium
Through the preset visual configuration interface, the problem of high difficulty in configuration of Pipeline scripts in the existing technology is solved, and a convenient and efficient configuration process is realized, which is suitable for non-technical users.
Patent Information
- Application Number
- CN202411671077.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing Pipeline script configuration requires users to have programming knowledge and experience in using Jenkins, resulting in a high threshold for use by non-technical users and an increased configuration difficulty.
Provide a Pipeline script configuration method. Through a preset visual configuration interface, users can input parameters and process configuration information, conduct automatic verification and generate Pipeline scripts, reducing configuration difficulty and technical thresholds, and improving convenience and flexibility.
It significantly reduces the complexity and difficulty of Pipeline script configuration, improves user experience, improves configuration efficiency and reliability, and is suitable for non-technical users to operate.
Smart Images

Figure CN119166133A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated development technology, and in particular to a Pipeline script configuration method, device, equipment and storage medium. Background Art
[0002] With the rise of DevOps (Development & Operations, the combination of development and operation) culture, automated building, testing and deployment are becoming more and more important in the software development process. Among them, Jenkins, as a popular open source automation server, implements the automation process of continuous integration (CI) and continuous deployment (CD) through Pipeline scripts.
[0003] However, existing Pipeline script writing usually requires users to have certain programming knowledge and experience in using Jenkins, which poses a high usage threshold for non-technical users and increases the difficulty of configuring Pipeline scripts. Summary of the invention
[0004] The problem solved by the present invention is: how to improve the convenience of Pipeline script configuration.
[0005] To solve the above problems, the present invention provides a Pipeline script configuration method, device, equipment and storage medium.
[0006] In a first aspect, the present invention provides a Pipeline script configuration method, comprising: In response to first parameters and process configuration information input by a user based on a preset visual configuration interface, verifying the first parameters and process configuration information; If the first parameter and the process configuration information meet the first preset condition, a Pipeline script is generated according to the first parameter and the process configuration information.
[0007] Optionally, after verifying the first parameter and process configuration information, the Pipeline script configuration method further includes: If the first parameter and the process configuration information do not satisfy the first preset condition, display information indicating an error with respect to the first parameter and the process configuration information is generated.
[0008] Optionally, the preset visual configuration interface includes a first visual configuration interface and a second visual configuration interface, and the first parameter and process configuration information includes parameter configuration information and process configuration information; In response to the first parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the first parameter and process configuration information includes: In response to the parameter configuration information input by the user based on the first visual configuration interface, the parameter configuration information is parsed to obtain a first Pipeline script, and the first Pipeline script is verified; in response to the process configuration information input by the user based on the second visual configuration interface, the process configuration information is parsed to obtain a second Pipeline script; If the first parameter and the process configuration information meet the first preset condition, generating a Pipeline script according to the first parameter and the process configuration information includes: If the first Pipeline script meets the first preset condition, the Pipeline script is generated according to the first Pipeline script and the second Pipeline script.
[0009] Optionally, if the first Pipeline script satisfies the first preset condition, generating the Pipeline script according to the first Pipeline script and the second Pipeline script includes: If the first Pipeline script meets the first preset condition, the second Pipeline script is integrated into the first Pipeline script to update the first Pipeline script to obtain the Pipeline script.
[0010] Optionally, the parameter configuration information includes name information, proxy environment information, trigger mode information, and construction parameter information; and parsing the parameter configuration information to obtain the first Pipeline script includes: The parameter configuration information is parsed to obtain the first Pipeline script including the Pipeline script code corresponding to at least one of the name information, the proxy environment information, the trigger mode information, and the construction parameter information.
[0011] Optionally, the process configuration information includes task process information; and parsing the process configuration information to obtain the second Pipeline script includes: Extract the stage information in the process configuration information and the task component information in the stage information, parse the stage information and the task component information, and obtain the second Pipeline script including the Pipeline script code corresponding to the stage information and the Pipeline script code corresponding to the task component information.
[0012] Optionally, if the first parameter and the process configuration information meet a first preset condition, after generating a Pipeline script according to the first parameter and the process configuration information, the Pipeline script configuration method further includes: In response to the second parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the second parameter and process configuration information; If the second parameter and the process configuration information meet the second preset condition, the Pipeline script is updated according to the second parameter and the process configuration information.
[0013] In a second aspect, the present invention provides a Pipeline script configuration device, including: A parsing and verification unit, configured to verify the first parameter and process configuration information in response to the first parameter and process configuration information input by the user based on the preset visual configuration interface; A script configuration unit is used to generate a Pipeline script according to the first parameters and the process configuration information if the first parameters and the process configuration information meet a first preset condition.
[0014] In a third aspect, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is used to implement the Pipeline script configuration method as described in the first aspect when executing the computer program.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program. When the computer program is read and executed by a processor, the Pipeline script configuration method as described in the first aspect is implemented.
[0016] Compared with the prior art, the present invention has the following beneficial effects: the present invention sets a preset visual configuration interface that is easy for users to intuitively understand and operate as a human-machine interface for users to configure Pipeline scripts, so that users can input the first parameter and process configuration information of the Pipeline script to be implemented based on the preset visual configuration interface, without directly editing the Pipeline script in plain text form, while reducing the difficulty, complexity and technical threshold of Pipeline script configuration, improving the flexibility, ease of use and convenience of Pipeline script configuration, and significantly improving user experience. And by automatically checking the first parameter and process configuration information input by the user, judging its validity and accuracy, and when the first parameter and process configuration information input by the user meet the first preset condition, directly generating the corresponding Pipeline script according to the first parameter and process configuration information input by the user, avoiding invalid Pipeline script generation according to the wrong information input by the user (i.e., the first parameter and process configuration information that do not meet the first preset condition), thereby saving time and resources, improving the efficiency of user configuration of Pipeline scripts, further improving user experience, and improving the reliability of the entire configuration process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of a flow chart of a Pipeline script configuration method in an embodiment of the present invention; Figure 2 A schematic diagram of a flow chart of a Pipeline script configuration method in an embodiment of the present invention; Figure 3 It is a structural block diagram of a Pipeline script configuration device in an embodiment of the present invention; Figure 4 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0020] Combination Figure 1 As shown, an embodiment of the present invention provides a Pipeline script configuration method, including: Step 100: In response to the first parameter and process configuration information input by the user based on a preset visual configuration interface, the first parameter and process configuration information are checked.
[0021] Specifically, in order to reduce the difficulty of Pipeline script configuration and improve the convenience of users configuring (or generating, creating) Pipeline scripts, in step 100, a visual interface (referred to as a preset visual configuration interface) that is easy for users to intuitively understand and operate is set as a human-machine interface for users to configure Pipeline scripts. Based on the preset visual configuration interface, users can input the first parameter and process configuration information about the Pipeline script to be implemented (or the automated process implemented by the Pipeline script), so that the subsequent steps of the method of this embodiment automatically generate the corresponding Pipeline script based on the first parameter and process configuration information. In this way, users can complete the configuration of the Pipeline script in a convenient visual configuration environment without directly editing the Pipeline script in plain text form. While reducing the difficulty and complexity of the Pipeline script configuration, the flexibility, ease of use and convenience of the Pipeline script configuration are improved, and the user experience is significantly improved. In some embodiments, the preset visualization configuration interface is configured on the corresponding hardware device (such as a terminal device or a server), and the user interface is presented through a display device that is connected to the hardware device in communication, that is, user-oriented visualization is realized. The user can input the first parameter and process configuration information through an input device (such as a keyboard or a touch screen, etc.) that is connected to the hardware device in communication, thereby realizing human-computer interaction and improving the convenience of user operation. Among them, the core components of the Pipeline script (such as execution agents, build parameters, triggering methods, etc.) can be graphically and modularly presented on the preset visualization configuration interface, so that the user can configure the first parameter and process configuration information by selecting and filling in the preset options, so as to further improve the convenience of Pipeline script configuration.
[0022] When the user inputs the corresponding first parameter and process configuration information based on the preset visual configuration interface, the information is automatically checked (such as the check on validity, accuracy, etc.) to determine the validity and accuracy of the first parameter and process configuration information input by the user, so as to facilitate timely taking of corresponding countermeasures according to the test results. For example, if the first parameter and process configuration information input by the user are checked to meet the corresponding conditions (such as the parameter format is correct, the required information is complete, the logical dependency relationship is reasonable, etc.), the Pipeline script required by the user can be generated based on the information; if the information does not meet the corresponding conditions (such as the parameter format does not meet the requirements, the required fields are missing, logical conflicts occur, etc.), an error or prompt is issued to guide the user to correct the input.
[0023] Step 210: If the first parameter and the process configuration information meet the first preset condition, generate a Pipeline script according to the first parameter and the process configuration information.
[0024] Specifically, in step 210, according to the inspection result of step 100, if the first parameter and process configuration information input by the user meet the first preset condition, it means that the inspection is passed, and the corresponding Pipeline script can be directly generated according to the first parameter and process configuration information input by the user. Exemplarily, according to the first parameter and process configuration information input by the user, including information such as each process step, trigger condition, and environment configuration, it is converted into the corresponding code snippet of the Pipeline script, and combined in a logical order to finally generate a complete Pipeline script; wherein, the generated Pipeline script is presented in a text form executable by Jenkins, for example, in the text format of the Groovy programming language. Among them, the first preset condition can be set according to actual needs.
[0025] In this way, the method of this embodiment sets a preset visual configuration interface that is easy for users to intuitively understand and operate as a human-machine interface for users to configure Pipeline scripts, so that users can input the first parameter and process configuration information of the Pipeline script to be implemented based on the preset visual configuration interface, without directly editing the Pipeline script in plain text form, while reducing the difficulty, complexity and technical threshold of Pipeline script configuration, improving the flexibility, ease of use and convenience of Pipeline script configuration, and significantly improving user experience. And by automatically checking the first parameter and process configuration information input by the user, judging its validity and accuracy, and when the first parameter and process configuration information input by the user meet the first preset condition, directly generating the corresponding Pipeline script according to the first parameter and process configuration information input by the user, avoiding invalid Pipeline script generation according to the wrong information input by the user (that is, the first parameter and process configuration information that do not meet the first preset condition), thereby saving time and resources, improving the efficiency of user configuration of Pipeline scripts, further improving user experience, and improving the reliability of the entire configuration process.
[0026] Optionally, combined Figure 2 After step 100, the Pipeline script configuration method further includes: Step 220: If the first parameter and the process configuration information do not satisfy the first preset condition, generate display information about the first parameter and the process configuration information error.
[0027] Exemplarily, in step 220, the first parameter and process configuration information input by the user are checked in real time, such as validity check and accuracy check, so as to timely find errors or unreasonable contents in the first parameter and process configuration information input by the user, and when it is determined that there are errors or unreasonable contents in the first parameter and process configuration information input by the user, that is, when it is determined that the first parameter and process configuration information do not meet the first preset condition, a display information about the error of the first parameter and process configuration information is generated, and an error or prompt is given to the user in time, so as to guide the user to correct the input in time and improve the configuration efficiency of the Pipeline script. For example, the specific cause of the error can be fed back to the user through the corresponding user interface (such as the preset visual configuration interface), so that the user can directly and intuitively understand and locate the specific configuration problem, so as to make targeted corrections in time.
[0028] Optionally, the preset visualization configuration interface includes a first visualization configuration interface and a second visualization configuration interface, and the first parameter and process configuration information includes parameter configuration information and process configuration information; Step 100 includes: In response to parameter configuration information input by the user based on the first visual configuration interface, the parameter configuration information is parsed to obtain a first Pipeline script, and the first Pipeline script is tested; in response to process configuration information input by the user based on the second visual configuration interface, the process configuration information is parsed to obtain a second Pipeline script; Step 210 includes: If the first Pipeline script meets the first preset condition, a Pipeline script is generated according to the first Pipeline script and the second Pipeline script.
[0029] Specifically, in order to avoid setting too many multifunctional components on a visual configuration interface and displaying too much content, which would affect user operations, two different visual interfaces (i.e., a first visual configuration interface and a second visual configuration interface) are provided, which are used to input parameter configuration information and process configuration information respectively. This makes the functional division of each interface clear, and users can input different information related to the configuration task in a targeted manner, thereby reducing the possibility of user misoperation and improving the accuracy of information input.
[0030] Parameter configuration information is the basic configuration information used to configure the Pipeline script, including name information, proxy environment information, trigger method information, build parameter information, etc. It is the basic configuration of the Pipeline script and is used to define the basic information of the process. The clear setting of parameter configuration information can ensure the uniqueness of the process, the correct selection of the execution environment, and the accuracy of the trigger method. The process configuration information includes task process information, which is used to define specific execution tasks and sequences to ensure that the logical process of the Pipeline script execution is reasonable.
[0031] Based on the difference between parameter configuration information and parameter configuration information type, the user may need to select specific parameter values when inputting parameter configuration information. These parameter values are often the basis for system operation, and their validity and correctness directly affect the legality and executability of Pipeline script generation. For example, the name information input by the user does not meet the specifications (such as repeated or illegal characters), which may lead to the inability to recognize the configuration. Therefore, it is necessary to verify the parameter configuration information input by the user. As for the process configuration information (task process information), it involves specific execution steps, task components, and execution order of different stages. Different projects and tasks often require different processes, and these processes do not have strict standard formats or universal validity restrictions. It is difficult to determine the corresponding verification standards, and too much verification will limit the user's ability to flexibly configure the process; and based on the type of process configuration information, the configuration of the process configuration information can be realized by the user performing graphical operations and selecting existing process components and connection methods. For example, the user can use drag and drop, selection, etc. to configure the process configuration information based on the functional components preset in the second visual configuration interface. This interactive method reduces the possibility of input errors. Therefore, there is no need to verify the process configuration information input by the user in step 210.
[0032] Therefore, in step 100, it is necessary to parse the parameter configuration information according to the parameter configuration information input by the user based on the first visual configuration interface, parse and generate the first Pipeline script corresponding to the parameter configuration information, and verify the validity, accuracy, etc. of the obtained first Pipeline script information; parse the process configuration information according to the process configuration information input by the user based on the second visual configuration interface to obtain the second Pipeline script. In step 210, according to the verification result of step 100, if the first Pipeline script meets the first preset condition, the first Pipeline script and the second Pipeline script can be integrated to generate a Pipeline script. In this way, by capturing the real-time input of the user and quickly verifying it, on the one hand, it is possible to promptly discover problems with the user's input information, so as to facilitate timely guidance of the user to make corrections; on the other hand, it is possible to ensure that the first Pipeline script corresponding to the parameter configuration information finally used to generate the Pipeline script can meet the first preset conditions in terms of basic requirements such as format and content, and ensure that the Pipeline script finally generated can meet user needs. Moreover, by verifying the first Pipeline script obtained by parsing the parameter configuration information, it is possible to promptly discover corresponding parameter configuration information that cannot generate Pipeline script code or generates incorrect Pipeline script code (or does not meet requirements), which facilitates users to identify and correct problems at an early stage, thereby avoiding waste of time and resources due to incorrect configuration information.
[0033] Optionally, the Pipeline script parser corresponding to the preset visual configuration interface can be used to parse the information input by the user based on the preset visual configuration interface, and generate the Pipeline script code corresponding to the user input information.
[0034] Optionally, the parameter configuration information may be directly verified, such as by converting the corresponding requirements of the script code corresponding to the parameter configuration information into the requirements for the parameter configuration information, and then directly verifying the parameter configuration information.
[0035] Optionally, if the first Pipeline script satisfies the first preset condition, generating the Pipeline script according to the first Pipeline script and the second Pipeline script includes: If the first Pipeline script meets the first preset condition, the second Pipeline script is integrated into the first Pipeline script to update the first Pipeline script to obtain a Pipeline script.
[0036] Specifically, according to the verification result of the first Pipeline script, if the first Pipeline script meets the first preset condition, it means that the verification is passed, and the first Pipeline script can be used to generate the final Pipeline script. At this time, the first Pipeline script can be used as the framework of the Pipeline script, and the second Pipeline script can be integrated into the framework as supplementary content (or updated content) to obtain the final Pipeline script. In this way, the orderly configuration of the Pipeline script is achieved, and the reliability and efficiency of the Pipeline script configuration are improved.
[0037] Optionally, the Pipeline script configuration method includes the following steps: A1. The user logs in to the preset visual configuration interface (herein, the first visual configuration interface), that is, the user enters the preset visual configuration interface for Pipeline script configuration through the corresponding login system; wherein, the preset visual configuration interface provides a friendly graphical user interface for Pipeline script configuration work, so that the user can configure the Pipeline script through intuitive operations; A2. Define a globally unique pipeline name. That is, the user needs to define a name for the Pipeline script to be configured. This name must be globally unique to identify and distinguish different Pipeline scripts. A3. Select the pipeline execution agent, that is, the user selects an execution agent (a server or service node that executes the pipeline task), which determines the execution location of the task in the pipeline; A4. Define pipeline construction parameters. That is, users can define pipeline construction parameters, such as strings, Boolean values, enumeration types, etc. These parameters will be used in the pipeline configuration process to meet different configuration requirements; A5. Define the pipeline triggering method, that is, the user configures the pipeline triggering method. You can choose Webhook (such as automatic triggering on code submission), timing (such as daily scheduled build) or manual triggering to meet different automation triggering requirements; A6. After the user completes the configuration of A2 to A5, the user saves the initial information (i.e., parameter configuration information), sends the initial information to Jenkins through the Jenkins API (i.e., Jenkins interface) that communicates with the preset visual configuration interface, and creates a preliminary pipeline (i.e., the first Pipeline script, as the above framework) to generate a pipeline with basic configuration (the specific task flow has not yet been completed).
[0038] A7. Enter the pipeline drawing interface (i.e., the second visual configuration interface), that is, the user enters a dedicated pipeline drawing interface, where a more detailed pipeline task flow (i.e., flow configuration information) can be defined by dragging and dropping components and configuring parameters. A8. Build task flow (flow configuration information). For example, users can configure specific task flows in the pipeline by dragging and dropping components. Each component corresponds to a build task. Users can set the execution order and specific parameters of each component to complete detailed build, test, and deployment tasks. A9, extracting process data from the process constructed in the graphical interface, that is, extracting process data including task sequence, execution conditions, trigger sequence, etc. from the process defined by the user in the graphical interface (the second visual configuration interface) (i.e., step A8); A10, Pipeline script converter converts the process data into a Pipeline script, that is, the process data extracted in A9 is passed to the Pipeline script converter, which converts the process data into a second Pipeline script in string form and integrates (or updates) it into the first Pipeline script obtained in step A6 to obtain the final Pipeline script; at this point, the entire pipeline script (Pipeline script) has a complete task flow and can be executed by Jenkins. The entire pipeline configuration and script generation process is completed, and users can now directly run the generated Pipeline to automatically execute the build, test, and deployment process.
[0039] Optionally, the parameter configuration information includes name information, proxy environment information, trigger mode information, and build parameter information; the parameter configuration information is parsed to obtain the first Pipeline script including: The parameter configuration information is parsed to obtain a first Pipeline script including a Pipeline script code corresponding to at least one of the name information, the proxy environment information, the trigger mode information, and the construction parameter information.
[0040] Specifically, by parsing the parameter configuration information, the parsing process uses each parameter configuration information (such as name information, proxy environment information, trigger mode information, and build parameter information) as a basic unit, and converts each parameter configuration information into a corresponding Pipeline script code fragment. Considering that there may be a situation where the corresponding parameter configuration information input by the user is incorrect and cannot be parsed, the first Pipeline script obtained includes at least one corresponding Pipeline script code among the name information, proxy environment information, trigger mode information, and build parameter information, and the parameter configuration information can be verified accordingly. Alternatively, when the parameter configuration information for user configuration only includes part of the name information, proxy environment information, trigger mode information, and build parameter information, the first Pipeline script finally obtained only includes the Pipeline script code obtained by parsing these parameter configuration information.
[0041] In this way, the parsing process uses each parameter configuration information as a basic unit and converts the parameter configuration information into code snippets in the first Pipeline script; these code snippets together constitute the core framework of the first Pipeline script, providing a basis for subsequent process configuration information integration.
[0042] Optionally, the Pipeline script parser includes a Pipeline definition parser. The Pipeline definition parser of the Pipeline script parser parses the parameter configuration information to obtain a first Pipeline script including at least one corresponding Pipeline script code of name information, proxy environment information, trigger mode information, and construction parameter information.
[0043] Optionally, the process configuration information includes task process information; the process configuration information is parsed to obtain the second Pipeline script including: Extract the stage information in the process configuration information and the task component information in the stage information, parse the stage information and the task component information, and obtain a second Pipeline script including the Pipeline script code corresponding to the stage information and the Pipeline script code corresponding to the task component information.
[0044] Specifically, considering that the process configuration information involves specific execution steps, task components, and the execution order of different stages, etc., and contains more information, therefore, the second Pipeline script is generated by parsing the process configuration information, specifically, the stage information and task component information in the process configuration information are extracted and parsed into corresponding Pipeline script code snippets. Among them, by generating independent Pipeline script code snippets from the stage information and task component information respectively, it is convenient for subsequent flexible integration and updating; and by completing the generation and integration of the second Pipeline script directly in the parsing stage, such as integrating the Pipeline script code snippets corresponding to the task component information in each stage with each stage as a unit, it is ensured that the generated second Pipeline script can strictly follow the execution order and hierarchical relationship configured by the user in the logical structure, so that the finally generated Pipeline script has a layered and clear structure, which is in line with the user's process design and convenient for subsequent adjustments and optimizations (such as adding or deleting stages, task components, or adjusting the execution order, etc., to achieve Pipeline script updates).
[0045] Optionally, after step 210, the Pipeline script configuration method further includes: In response to the second parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the second parameter and the process configuration information; If the second parameter and the process configuration information meet the second preset condition, the Pipeline script is updated according to the second parameter and the process configuration information.
[0046] Specifically, for the Pipeline script completed through step 100 and step 210, if the user needs to update it, such as deleting the corresponding stage, task component in the Pipeline script, or adding a new stage, task component, or adjusting the execution order of the corresponding stage, the execution order of the corresponding execution order, etc., the user can continue to input new parameters and process configuration information (recorded as the second parameters and process configuration information) based on the preset visual configuration interface. When the second parameters and process configuration information meet the second preset condition, the Pipeline script is updated according to the second parameters and process configuration information, so that the original Pipeline script is updated to the latest script corresponding to the second parameters and process configuration information. Among them, the second preset condition can be set according to actual needs.
[0047] Optionally, the Pipeline script configuration method includes the following steps: S1. The pipeline definition parser first receives the parameter configuration information generated by the user through the visual configuration interface and starts parsing the data; S2. Parse the pipeline name. That is, the parser extracts the pipeline name from the parameter configuration information and performs a standard check on the name to ensure that it complies with the naming rules and is unique in the system. If it complies, the Pipeline script code corresponding to the name is generated; S3, parsing the pipeline proxy, that is, the parser extracts the proxy environment information selected by the user, such as physical server or cloud service, and generates the corresponding Pipeline script code about the script proxy tag (used to indicate where the pipeline task will be executed); S4. Analyze the pipeline trigger mode, that is, according to the trigger mode set by the user (such as Webhook, timed trigger or manual trigger, etc.), the parser generates the corresponding Pipeline script code about the trigger script data; S5. Parse build parameters, that is, parse user-defined build parameters (strings, Boolean values, enumerations, etc.) and generate Pipeline script code in the form of script representations of these build parameters; S6. Extract pipeline stage data. The pipeline definition parser of the Pipeline script parser can extract the stage data in the process configuration information and transmit it to the pipeline stage parser of the Pipeline script parser to prepare to parse the information of each stage. S7, the pipeline stage parser receives data, that is, the pipeline stage parser receives the stage data, starts to parse the information of each stage one by one, and prepares to generate the Pipeline script code of each stage; S8, polling stage data, the parser obtains the data of each stage in turn through polling, and processes each stage in turn; S9, parsing the stage name, for each stage, parsing its name and generating independent script data of the stage, so that subsequent task steps can be embedded in the corresponding stage; S10, extracting task component data, the parser extracts the task component data in the current stage and transmits the data to the task component parser for further processing; S11, the task component parser receives data. The task component parser receives the transmitted task component data, prepares to parse each task component, and generates the corresponding Pipeline script code; S12, polling task component data, the parser obtains the data of each task component in turn and parses them one by one; S13, parsing the task component identifier, parsing the identifier of the current task component, determining the specific component parser to be called according to the identifier, and preparing to further parse the component data; S14, calling the component parser, calling the corresponding component parser according to the identifier of the task component, and parsing the data into the Pipeline script code of the component; S15, completing task component parsing. After the current task component is parsed, return to step S12 to obtain the next task component data, and continue to execute steps S13 to S14 until all task components are parsed; S16, merging stage script data. After the task component parser completes the script generation of all task components in the current stage, it merges these data to form the complete script data of this stage and returns it to the pipeline stage parser; S17, process the next stage, i.e. return to step S8, obtain the data of the next stage in sequence, and execute S9 to S16 until the data of all stages are processed; S18, merging pipeline script data, that is, after all stage data parsing is completed, the pipeline definition parser aggregates the script data of each stage (that is, aggregates the first Pipeline script corresponding to the parameter configuration information and the second Pipeline script corresponding to the process configuration information) and merges them to generate a complete Pipeline script; S19, end, that is, the pipeline parsing process is completed, and the generated Pipeline script can be used for subsequent building, testing and deployment processes.
[0048] Combination Figure 3 As shown, another embodiment of the present invention provides a Pipeline script configuration device, including: A parsing and verification unit, configured to verify the first parameter and the process configuration information in response to the first parameter and the process configuration information input by the user based on the preset visual configuration interface; The script configuration unit is used to generate a Pipeline script according to the first parameter and the process configuration information if the first parameter and the process configuration information meet a first preset condition.
[0049] The Pipeline script configuration device of this embodiment is used to implement the above-mentioned Pipeline script configuration method. Its advantages over the prior art are the same as the advantages of the above-mentioned Pipeline script configuration method over the prior art, and will not be repeated here.
[0050] Combination Figure 4 As shown, another embodiment of the present invention provides an electronic device, including a memory 401 and a processor 402; Memory 401, used for storing computer programs; The processor 402 is used to implement the above-mentioned Pipeline script configuration method when executing the computer program.
[0051] In other words, an electronic device includes a memory 401 and a processor 402 coupled to the memory 401; the memory 401 is configured to store a computer program; and the processor 402 is configured to perform the following operations when executing the computer program: In response to the first parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the first parameter and process configuration information; If the first parameter and the process configuration information meet the first preset condition, a Pipeline script is generated according to the first parameter and the process configuration information.
[0052] The electronic device of this embodiment can be used to implement the above-mentioned Pipeline script configuration method. Its advantages over the prior art are the same as the advantages of the above-mentioned Pipeline script configuration method over the prior art, and will not be repeated here.
[0053] Another embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor, the above-mentioned Pipeline script configuration method is implemented.
[0054] In other words, a non-volatile computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following operations: In response to the first parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the first parameter and process configuration information; If the first parameter and the process configuration information meet the first preset condition, a Pipeline script is generated according to the first parameter and the process configuration information.
[0055] The technical solution of the embodiment of the present invention, in essence or in other words, the part that contributes to the prior art, or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of the embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0056] The computer-readable storage medium of this embodiment can be used to implement the above-mentioned Pipeline script configuration method. Its advantages over the prior art are the same as the advantages of the above-mentioned Pipeline script configuration method over the prior art, and will not be repeated here.
[0057] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A Pipeline script configuration method, characterized in that: include: In response to first parameters and process configuration information input by a user based on a preset visual configuration interface, verifying the first parameters and process configuration information; If the first parameter and the process configuration information meet the first preset condition, a Pipeline script is generated according to the first parameter and the process configuration information.
2. The Pipeline script configuration method according to claim 1, characterized in that: After checking the first parameter and the process configuration information, the Pipeline script configuration method further includes: If the first parameter and the process configuration information do not satisfy the first preset condition, display information indicating an error with respect to the first parameter and the process configuration information is generated.
3. The Pipeline script configuration method according to claim 1, characterized in that: The preset visualization configuration interface includes a first visualization configuration interface and a second visualization configuration interface, and the first parameter and process configuration information includes parameter configuration information and process configuration information; In response to the first parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the first parameter and process configuration information includes: In response to the parameter configuration information input by the user based on the first visual configuration interface, the parameter configuration information is parsed to obtain a first Pipeline script, and the first Pipeline script is verified; in response to the process configuration information input by the user based on the second visual configuration interface, the process configuration information is parsed to obtain a second Pipeline script; If the first parameter and the process configuration information meet the first preset condition, generating a Pipeline script according to the first parameter and the process configuration information includes: If the first Pipeline script meets the first preset condition, the Pipeline script is generated according to the first Pipeline script and the second Pipeline script.
4. The Pipeline script configuration method according to claim 3, characterized in that: If the first Pipeline script satisfies the first preset condition, generating the Pipeline script according to the first Pipeline script and the second Pipeline script includes: If the first Pipeline script meets the first preset condition, the second Pipeline script is integrated into the first Pipeline script to update the first Pipeline script to obtain the Pipeline script.
5. The Pipeline script configuration method according to claim 3, characterized in that: The parameter configuration information includes name information, proxy environment information, trigger mode information, and construction parameter information; the parsing of the parameter configuration information to obtain the first Pipeline script includes: The parameter configuration information is parsed to obtain the first Pipeline script including the Pipeline script code corresponding to at least one of the name information, the proxy environment information, the trigger mode information, and the construction parameter information.
6. The Pipeline script configuration method according to claim 3, characterized in that: The process configuration information includes task process information; the parsing of the process configuration information to obtain the second Pipeline script includes: Extract the stage information in the process configuration information and the task component information in the stage information, parse the stage information and the task component information, and obtain the second Pipeline script including the Pipeline script code corresponding to the stage information and the Pipeline script code corresponding to the task component information.
7. The Pipeline script configuration method according to any one of claims 1 to 6, characterized in that: If the first parameter and the process configuration information meet the first preset condition, after generating the Pipeline script according to the first parameter and the process configuration information, the Pipeline script configuration method further includes: In response to the second parameter and process configuration information input by the user based on the preset visual configuration interface, verifying the second parameter and process configuration information; If the second parameter and the process configuration information meet the second preset condition, the Pipeline script is updated according to the second parameter and the process configuration information.
8. A Pipeline script configuration device, characterized in that: include: A parsing and verification unit, configured to verify the first parameter and process configuration information in response to the first parameter and process configuration information input by the user based on the preset visual configuration interface; A script configuration unit is used to generate a Pipeline script according to the first parameters and the process configuration information if the first parameters and the process configuration information meet a first preset condition.
9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to implement the Pipeline script configuration method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is read and executed by a processor, the Pipeline script configuration method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Assembly line construction method and system based on parameter configuration
CN111506304A
Assembly line arrangement method and device, electronic equipment and storage medium
CN111722842A
Assembly line construction method and device, computer equipment and storage medium
CN115934500A
Assembly line packaging deployment method and device, computer equipment and storage medium
CN118838602A
