Assembly line global variable use method and device and medium
By directly referring to the pipeline global variables in the preset pipeline environment in the pipeline, the data security risks caused by the need to log in to the pipeline environment in the existing technology to use global variables are solved, achieving higher data security and reducing account leakage.
Patent Information
- Application Number
- CN202311126229.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-04
AI Technical Summary
When using pipeline global variables in the prior art, you must log in to the pipeline environment to set and use it, resulting in data security risks.
By directly referring to the pipeline global variables in the preset pipeline environment in the pipeline, there is no need to log in to the pipeline environment, thereby reducing the risk of account leakage and increasing data security.
It solves the data security risks when using global variables in pipelines in the prior art, improves data security, and reduces the possibility of account leakage.
Smart Images

Figure CN119556888A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software development, and in particular to a method, device and medium for using pipeline global variables. Background Art
[0002] CI (Continuous Integration) / CD (Continuous Delivery) pipelines enable automatic service building, testing, deployment, and on-demand delivery. The support for variables in the current mainstream CI / CD pipeline building tools is limited to the building tool level. To declare variables when creating a pipeline, you must log in to the building tool settings. Commonly used building tools include Jenkins and GitLab-CI.
[0003] Jenkins is an open source continuous integration (CI) tool that provides a user-friendly interface. Global variables in Jenkins need to be set in the Global properties option and referenced in the pipeline script using the format of ${variable name}.
[0004] The existing technology still has the following disadvantages when using pipeline global variables: data is not secure. When using pipeline global variables in daily life, you must log in to the pipeline environment to set and use the pipeline global variables, resulting in data security risks. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method, device and medium for using pipeline global variables in view of the above-mentioned deficiencies in the prior art, so as to solve the problem that in the prior art, when using pipeline global variables in daily life, it is necessary to log in to the pipeline environment to set and use the pipeline global variables, resulting in data security risks.
[0006] In a first aspect, the present invention provides a method for using a pipeline global variable, comprising:
[0007] Receive the pipeline creation instruction sent by the user after selecting a preset pipeline environment with pipeline global variables based on the front-end page;
[0008] Creating a target pipeline according to the pipeline creation instruction;
[0009] Receive the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment;
[0010] Saving the script with the target pipeline global variable name added to the pipeline environment;
[0011] When receiving the execution instruction from the user, according to the execution instruction, the name in the script is replaced with the value of the target pipeline global variable, and the target pipeline is executed.
[0012] Furthermore, after receiving the preset pipeline environment with pipeline global variables selected by the user based on the front-end page and before sending the pipeline creation instruction, the method further includes:
[0013] Configuring the pipeline environment;
[0014] The name and value of at least one pipeline global variable are added to the pipeline environment and saved to obtain the pipeline environment with the pipeline global variable.
[0015] Further, creating a target pipeline according to the pipeline creation instruction specifically includes:
[0016] According to the creation instruction, receiving the name of the pipeline global variable selected by the user in the pipeline environment;
[0017] When assembling the target pipeline script, the name of the selected pipeline global variable is imported into the target pipeline script to obtain the target pipeline.
[0018] Furthermore, the name of the target pipeline global variable introduced into the target pipeline script when the receiving user edits the target pipeline specifically includes:
[0019] The name of the target pipeline global variable referenced in the target pipeline script according to a preset reference form is received when the user edits the target pipeline.
[0020] Furthermore, before replacing the name in the script with the value of the target pipeline global variable according to the execution instruction and executing the target pipeline, the method further includes:
[0021] Get the value of the target pipeline global variable corresponding to this execution.
[0022] Furthermore, there are multiple pipeline environments with pipeline global variables, and different pipeline environments can be stored in different pipeline clusters. The method also includes:
[0023] According to a preset unified integrated application program interface API, pipeline global variables in pipeline environments corresponding to the plurality of pipeline clusters are overwritten so that the pipeline global variables can be used across clusters.
[0024] In a second aspect, the present invention provides a pipeline global variable using device, comprising:
[0025] A first receiving module is used to receive a pipeline creation instruction sent by a user after selecting a preset pipeline environment with pipeline global variables based on a front-end page;
[0026] A creation module, connected to the first receiving module, and used to create a target pipeline according to the pipeline creation instruction;
[0027] A second receiving module, connected to the creation module, for receiving the name of a target pipeline global variable introduced into the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment;
[0028] A saving module, connected to the second receiving module, for saving the script with the target pipeline global variable name added to the pipeline environment;
[0029] The replacement module is connected to the saving module and is used for replacing the name in the script with the value of the target pipeline global variable according to the execution instruction when receiving the user's execution instruction, and executing the target pipeline.
[0030] Furthermore, the device also includes:
[0031] A configuration module, used to configure the pipeline environment;
[0032] An adding module is used to add and save the name and value of at least one pipeline global variable in the pipeline environment to obtain the pipeline environment with the pipeline global variable.
[0033] In a third aspect, the present invention provides a pipeline global variable use device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the pipeline global variable use method described in the first aspect above.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for using the pipeline global variables described in the first aspect is implemented.
[0035] The pipeline global variable use method, device and medium provided by the present invention first receive the pipeline creation instruction sent by the user after selecting the preset pipeline environment with pipeline global variables based on the front-end page; then create the target pipeline according to the pipeline creation instruction; then receive the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment; and save the script with the target pipeline global variable name added to the pipeline environment; finally, when receiving the user's execution instruction, according to the execution instruction, replace the name in the script with the value of the target pipeline global variable, and execute the target pipeline. The present invention directly references the pipeline global variables in the preset pipeline environment in the pipeline, does not need to log in to the pipeline environment, thereby reducing the risk of account leakage and increasing data security, and solves the problem that the prior art must log in to the pipeline environment to set and use pipeline global variables when using pipeline global variables in daily life, resulting in data security risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a flow chart of a method for using pipeline global variables according to Embodiment 1 of the present invention;
[0037] Figure 2 A global variable declaration flow chart of an embodiment of the present invention;
[0038] Figure 3 This is a bottom-level architecture diagram for using global variables across clusters in an embodiment of the present invention;
[0039] Figure 4 A flow chart of global variable usage according to an embodiment of the present invention;
[0040] Figure 5 An interactive schematic diagram of a method for using pipeline global variables according to an embodiment of the present invention;
[0041] Figure 6 This is a structural schematic diagram of a pipeline global variable using device according to Embodiment 2 of the present invention;
[0042] Figure 7 This is a structural schematic diagram of a pipeline global variable using device according to embodiment 3 of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0044] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.
[0045] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.
[0046] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.
[0047] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0048] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.
[0049] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0050] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.
[0051] Application Overview
[0052] DevOps is a collective name for a set of processes, methods, and systems that promote communication, collaboration, and integration between development, technical operations, and quality assurance (QA) departments.
[0053] CI (Continuous Integration) / CD (Continuous Delivery) pipelines enable automatic service building, testing, deployment, and on-demand delivery. The support for variables in the current mainstream CI / CD pipeline building tools is limited to the building tool level. To declare variables when creating a pipeline, you must log in to the building tool settings. Commonly used building tools include Jenkins and GitLab-CI.
[0054] A pipeline is a set of automated processes that execute a series of events or jobs that enable DevOps professionals and developers to reliably and efficiently compile, build, and deploy their code to production computing platforms.
[0055] Jenkins is an open source continuous integration (CI) tool that provides a user-friendly interface. Global variables in Jenkins need to be set in the Global properties option and referenced in the pipeline script using the format of ${variable name}.
[0056] K8S stands for kubernetes, an open source production-level container orchestration system, a full-featured microservice framework and cloud-native platform.
[0057] The prior art still has the following disadvantages when using pipeline global variables:
[0058] 1. Data is not secure. When using pipeline global variables in daily life, you must log in to the pipeline environment (that is, the Jenkins environment) to set and use pipeline global variables (the user must have a server account), which leads to data security risks;
[0059] 2. The operation page is not friendly enough, not user-friendly enough, and the page functions are not easy to view;
[0060] 3. The operation threshold is high, and you must be familiar with the use of Jenkins and the pipeline syntax structure;
[0061] 4. Global variables cannot be used across clusters.
[0062] In response to the above technical problems, the present application directly references the pipeline global variables in the preset pipeline environment in the pipeline, without the need to log in to the pipeline environment, thereby reducing the risk of account leakage and increasing data security. This at least solves the problem that in the prior art, when using pipeline global variables in daily life, one must log in to the pipeline environment to set and use pipeline global variables, resulting in data security risks.
[0063] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0064] Embodiment 1:
[0065] This embodiment provides a method for using pipeline global variables, such as Figure 1 As shown, the method includes:
[0066] Step S101: receiving a pipeline creation instruction sent by a user after selecting a preset pipeline environment with pipeline global variables based on a front-end page.
[0067] It should be noted that the pipeline global variable usage method provided in this embodiment is applied to the ladder DevOps platform provided in this embodiment.
[0068] Specifically, after the user selects a preset pipeline environment with pipeline global variables through the front-end page, he sends a pipeline creation instruction, and the Tianti DevOps platform receives the pipeline creation instruction sent by the user.
[0069] In an optional embodiment, after receiving the preset pipeline environment with pipeline global variables selected by the user based on the front-end page and before sending the pipeline creation instruction, the method further includes:
[0070] Configuring the pipeline environment;
[0071] The name and value of at least one pipeline global variable are added to the pipeline environment and saved to obtain the pipeline environment with the pipeline global variable.
[0072] Specifically, Figure 2 As shown in the figure, the declaration and usage scope of pipeline global variables are distinguished by the environment dimension. The specific method is as follows:
[0073] (1) Configure the pipeline execution Jenkins environment and permissions;
[0074] (2) Add global variables, select the Jenkins environment to be released, and add the global variable name (KEY) and value (VALUE);
[0075] (3) Save global variables and environment associations for persistent storage.
[0076] Step S102: Create a target pipeline according to the pipeline creation instruction.
[0077] It should be noted that in this embodiment, there are two ways to use global variables:
[0078] 1. Directly reference the global variable name (KEY) in the target pipeline script;
[0079] 2. Enable global variables in the corresponding run phase and select the corresponding global variables to be used.
[0080] Specifically, in the first usage method of the above-mentioned global variable (directly referenced by the global variable name (KEY) in the target pipeline script), the Tianti DevOps platform creates the target pipeline according to the pipeline creation instruction.
[0081] In an optional embodiment, creating a target pipeline according to the pipeline creation instruction specifically includes:
[0082] According to the creation instruction, receiving the name of the pipeline global variable selected by the user in the pipeline environment;
[0083] When assembling the target pipeline script, the name of the selected pipeline global variable is imported into the target pipeline script to obtain the target pipeline.
[0084] Specifically, the second method of using the above-mentioned global variables (enabling global variables in the corresponding running stage and selecting the corresponding global variables to be used) is as follows: according to the creation instructions, in the corresponding running stage, the user queries the global variables in the current environment, selects the name of the global variable to be used, receives the name of the pipeline global variable selected by the user, and when the target pipeline script is assembled, the global variables are imported into the target pipeline script in the form of method parameters, and the reference form is #KEY#.
[0085] Step S103: receiving the name of the target pipeline global variable introduced into the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment.
[0086] Specifically, the first method of using the above-mentioned global variables (directly referencing with the global variable name (KEY) in the target pipeline script) is as follows: the user uses the global variable in the target pipeline script, and the reference format is #KEY#, wherein the KEY used must be a global variable that has been set in the current environment, and the name of the target pipeline global variable is referenced in the target pipeline script according to the preset reference format (i.e. #KEY#) when the receiving user edits the target pipeline.
[0087] Step S104: Save the script with the target pipeline global variable name added to the pipeline environment.
[0088] Specifically, the Tianti DevOps platform saves the script with the target pipeline global variable name added to the Jenkins environment.
[0089] Step S105: upon receiving the execution instruction from the user, according to the execution instruction, the name in the script is replaced with the value of the target pipeline global variable, and the target pipeline is executed.
[0090] Specifically, when a user triggers an execution instruction by single-clicking, double-clicking, long pressing, or touching a preset object, where the preset object can be in any form such as a button, text, or picture, the Tianti DevOps platform receives the user's execution instruction, and according to the execution instruction, obtains the value of the target pipeline global variable corresponding to this execution. The global variable value (that is, the value corresponding to this execution) replaces the content of the global variable name (KEY) before the target pipeline actually runs, and executes the target pipeline.
[0091] In an optional embodiment, there are multiple pipeline environments with pipeline global variables, and different pipeline environments can be stored in different pipeline clusters. The method further includes:
[0092] According to a preset unified integrated application program interface API, pipeline global variables in pipeline environments corresponding to the plurality of pipeline clusters are overwritten so that the pipeline global variables can be used across clusters.
[0093] Specifically, Figure 3 As shown, global variables can be declared in different Jenkins environments, and different Jenkins environments can be stored in different Jenkins clusters, scheduled through a unified integrated API (Application Programming Interface), and overwrite global variables in different Jenkins environments at the same time to ensure that the content stored in them is consistent.
[0094] It should be noted that the method of using cross-cluster global variables is the same as the method of using the above global variables, and the underlying implementation details are transparent to users.
[0095] It is worth mentioning that, combined with global variables, the branch to be pulled or the path to be deployed can be specified as a global variable at different stages of pipeline pulling. Each time the pipeline is built, the required value can be specified. There is no need to modify the content in multiple pipelines, ensuring that the modified content is integrated in one entry (that is, global variables), so that single-point modification can take effect in multiple places, avoiding omission of modified content. Combined with global variables, the construction and deployment can be separated. The address of the pipeline artifact is placed in the global variable. In the deployment stage, the artifact is pulled from the corresponding global variable, which reduces the coupling between the stages. The construction and deployment are separated, and the generated artifacts are stored in the artifact library in advance. When it is time to deploy, the artifacts are pulled from the artifact library for deployment. The ability to provide global variables in the Tianti DevOps platform does not require logging in to the Jenkins environment to use the built-in environment variables (that is, global variables). By encrypting the content of the global variables and decrypting the values accordingly, the risk of sensitive information leakage is reduced, the server security and stability are increased, and the risk of password and sensitive data leakage is reduced.
[0096] In a specific embodiment, the present invention uniformly encapsulates Jenkins operations to reduce the risk of account leakage and increase data security; provides a user-friendly interactive page for adding pipeline global variables; lowers the threshold for using pipeline global variables, provides pipeline templates, and reduces the complexity of writing scripts; and uses global variables across clusters. The Tianti DevOps platform in the present invention provides a global variable function, adds global variables in the executing Jenkins environment, and directly references global variables in the pipeline (that is, the target pipeline), so that single-point modification is achieved and takes effect globally. In the pipeline of the present invention, the content displayed on the front end is the global variable name, and the actual script in Jenkins is the latest value of the global variable. The introduction of global variables that can be used across clusters has greatly improved the security, applicability, and stability of global variables. Specifically, Figure 4 As shown, the entire process directly referenced by the global variable name (KEY) in the target pipeline script can include the following steps:
[0097] (1) Select the Jenkins environment with global variables, perform pipeline orchestration, and create a pipeline;
[0098] (2) Use global variables in the pipeline script, and reference them in the form of #KEY#;
[0099] (3) The script is saved and verified. The KEY used must be a global variable that has been set in the current environment.
[0100] (4) Update the value of the global variable before the pipeline is executed and update the Jenkins script;
[0101] (5) Pipeline execution.
[0102] In another specific embodiment, Figure 5 FIG. 1 is an interactive schematic diagram of a method for using a pipeline global variable provided by an embodiment of the present invention, comprising the following steps:
[0103] (1) The user selects the Jenkins environment with global variables on the front-end page, creates a pipeline, and assembles the pipeline script;
[0104] (2) In the corresponding running phase, query the global variables in the current environment and select the variables to be used;
[0105] (3) Assembly of pipeline scripts: global variables are imported into the pipeline scripts as method parameters, and the reference format is #KEY#;
[0106] (4) The backend service verifies the legality of the pipeline;
[0107] (5) After verification, obtain the actual value of the global variable, update the script and save the script to Jenkins, and the pipeline executes the updated script.
[0108] The method for using pipeline global variables provided by the embodiment of the present invention first receives the pipeline creation instruction sent by the user after selecting the preset pipeline environment with pipeline global variables based on the front-end page; then creates the target pipeline according to the pipeline creation instruction; then receives the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment; and saves the script with the target pipeline global variable name added to the pipeline environment; finally, when receiving the user's execution instruction, according to the execution instruction, replaces the name in the script with the value of the target pipeline global variable, and executes the target pipeline. The present invention directly references the pipeline global variables in the preset pipeline environment in the pipeline, does not need to log in to the pipeline environment, thereby reducing the risk of account leakage and increasing data security, and solves the problem that the prior art must log in to the pipeline environment to set and use pipeline global variables when using pipeline global variables in daily life, resulting in data security risks.
[0109] Embodiment 2:
[0110] like Figure 6 As shown, this embodiment provides a pipeline global variable using device, which is used to execute the above pipeline global variable using method, including:
[0111] The first receiving module 11 is used to receive a pipeline creation instruction sent by a user after selecting a preset pipeline environment with pipeline global variables based on a front-end page;
[0112] A creation module 12, connected to the first receiving module 11, for creating a target pipeline according to the pipeline creation instruction;
[0113] A second receiving module 13, connected to the creation module 12, for receiving the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment;
[0114] A saving module 14, connected to the second receiving module 13, for saving the script with the target pipeline global variable name added to the pipeline environment;
[0115] The replacement module 15 is connected to the saving module 14 and is used for replacing the name in the script with the value of the target pipeline global variable according to the execution instruction when receiving the user's execution instruction, and executing the target pipeline.
[0116] Furthermore, the device also includes:
[0117] A configuration module, used to configure the pipeline environment;
[0118] An adding module is used to add and save the name and value of at least one pipeline global variable in the pipeline environment to obtain the pipeline environment with the pipeline global variable.
[0119] Furthermore, the creation module 12 specifically includes:
[0120] A receiving unit, configured to receive, according to the creation instruction, a name of a pipeline global variable selected by a user in the pipeline environment;
[0121] The import unit is used to import the name of the selected pipeline global variable into the target pipeline script when assembling the target pipeline script to obtain the target pipeline.
[0122] Furthermore, the second receiving module 13 is specifically used for:
[0123] The name of the target pipeline global variable referenced in the target pipeline script according to a preset reference form is received when the user edits the target pipeline.
[0124] Furthermore, the device also includes:
[0125] The acquisition module is used to obtain the value of the target pipeline global variable corresponding to this execution.
[0126] Furthermore, there are multiple pipeline environments with pipeline global variables, and different pipeline environments can be stored in different pipeline clusters. The device also includes:
[0127] The overwriting module is used to overwrite the pipeline global variables in the pipeline environment corresponding to the plurality of pipeline clusters according to a preset unified integrated application program interface API, so that the pipeline global variables can be used across clusters.
[0128] Embodiment 3:
[0129] refer to Figure 7This embodiment provides a pipeline global variable use device, including a memory 21 and a processor 22, the memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the pipeline global variable use method in Example 1.
[0130] The memory 21 is connected to the processor 22. The memory 21 may be a flash memory, a read-only memory or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.
[0131] Embodiment 4:
[0132] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for using the pipeline global variables in the above-mentioned embodiment 1 is implemented.
[0133] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0134] In summary, the pipeline global variable use method, device and medium provided by the embodiment of the present invention first receive the pipeline creation instruction sent by the user after selecting the preset pipeline environment with pipeline global variables based on the front-end page; then create the target pipeline according to the pipeline creation instruction; then receive the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment; and save the script with the target pipeline global variable name added to the pipeline environment; finally, when receiving the user's execution instruction, according to the execution instruction, replace the name in the script with the value of the target pipeline global variable, and execute the target pipeline. The present invention directly references the pipeline global variables in the preset pipeline environment in the pipeline, does not need to log in to the pipeline environment, thereby reducing the risk of account leakage and increasing data security, and solves the problem that the prior art must log in to the pipeline environment to set and use pipeline global variables when using pipeline global variables in daily life, resulting in data security risks.
[0135] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for using pipeline global variables, characterized in that: The method comprises: Receive the pipeline creation instruction sent by the user after selecting a preset pipeline environment with pipeline global variables based on the front-end page; Creating a target pipeline according to the pipeline creation instruction; Receive the name of the target pipeline global variable introduced in the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment; Saving the script with the target pipeline global variable name added to the pipeline environment; When receiving the execution instruction from the user, according to the execution instruction, the name in the script is replaced with the value of the target pipeline global variable, and the target pipeline is executed.
2. The method according to claim 1, characterized in that: After receiving the preset pipeline environment with pipeline global variables selected by the user based on the front-end page and before sending the pipeline creation instruction, the method further includes: Configuring the pipeline environment; The name and value of at least one pipeline global variable are added to the pipeline environment and saved to obtain the pipeline environment with the pipeline global variable.
3. The method according to claim 1, characterized in that The step of creating a target pipeline according to the pipeline creation instruction specifically includes: According to the creation instruction, receiving the name of the pipeline global variable selected by the user in the pipeline environment; When assembling the target pipeline script, the name of the selected pipeline global variable is imported into the target pipeline script to obtain the target pipeline.
4. The method according to claim 1, characterized in that: The receiving user edits the target pipeline and introduces the name of the target pipeline global variable in the target pipeline script, specifically including: The name of the target pipeline global variable referenced in the target pipeline script according to a preset reference form is received when the user edits the target pipeline.
5. The method according to claim 1, characterized in that Before replacing the name in the script with the value of the target pipeline global variable according to the execution instruction and executing the target pipeline, the method further includes: Get the value of the target pipeline global variable corresponding to this execution.
6. The method according to claim 1, characterized in that There are multiple pipeline environments with pipeline global variables, and different pipeline environments can be stored in different pipeline clusters. The method also includes: According to a preset unified integrated application program interface API, pipeline global variables in pipeline environments corresponding to the plurality of pipeline clusters are overwritten so that the pipeline global variables can be used across clusters.
7. A pipeline global variable using device, characterized in that: include: A first receiving module is used to receive a pipeline creation instruction sent by a user after selecting a preset pipeline environment with pipeline global variables based on a front-end page; A creation module, connected to the first receiving module, and used to create a target pipeline according to the pipeline creation instruction; A second receiving module, connected to the creation module, for receiving the name of a target pipeline global variable introduced into the target pipeline script when the user edits the target pipeline; wherein the target pipeline global variable is one of the pipeline global variables in the pipeline environment; A saving module, connected to the second receiving module, for saving the script with the target pipeline global variable name added to the pipeline environment; The replacement module is connected to the saving module and is used for replacing the name in the script with the value of the target pipeline global variable according to the execution instruction when receiving the user's execution instruction, and executing the target pipeline.
8. The device according to claim 7, characterized in that The device also includes: A configuration module, used to configure the pipeline environment; An adding module is used to add and save the name and value of at least one pipeline global variable in the pipeline environment to obtain the pipeline environment with the pipeline global variable.
9. A pipeline global variable using device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the pipeline global variable using method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for using a pipeline global variable according to any one of claims 1 to 6 is implemented.