Method and device for realizing dynamic creation of Jenkins assembly line
By introducing automated assembly methods of pipeline templates and Jenkins plug-in, the problems of high learning costs and difficult management of Jenkins pipelines are solved, and efficient management and stability of the pipelines are achieved.
Patent Information
- Application Number
- CN202411734173.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, the learning cost of the Jenkins assembly line is high and the management difficulties are difficult, especially when there are many projects, which leads to difficulty in upgrading the project and low reliability.
By introducing pipeline templates, responding to developers' selection and configuration operations, identify and configure target pipeline templates from the version control system, use the Jenkins plug-in to intercept build requests before the project construction process, download and generate pipeline scripts.
Reduces learning costs, improves management efficiency, enhances maintainability and stability of the assembly line, improves project delivery speed, reduces errors and improves reliability.
Smart Images

Figure CN119668720A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for realizing dynamic creation of a Jenkins pipeline. Background Art
[0002] With the popularity of DevOps, more and more companies are beginning to adopt DevOps platforms, among which Jenkins, as one of the important DevOps tool chains, is favored by companies. In short, Pipeline is a workflow framework running on Jenkins, which connects tasks that originally run independently on a single or multiple nodes to achieve complex process orchestration and visualization that are difficult to complete with a single task; Pipeline is a set of plug-ins that allows Jenkins to implement the continuous delivery pipeline.
[0003] However, to implement a custom Pipeline, users must have a deep understanding of the syntax of Jenkins Pipeline, research plug-ins that suit their needs, and then write Pipeline scripts based on Jenkins project requirements. This process involves complex script writing logic and extensive requirements design, resulting in high project investment and low reliability. In addition, from the perspective of the enterprise, if the Pipeline scripts cannot be managed in a unified manner, especially when there are many projects, it will inevitably cause difficulties in project upgrades, which will affect the entire system and prevent the enterprise from fully enjoying the convenience brought by DevOps. Summary of the invention
[0004] The present invention provides a method and device for realizing dynamic creation of a Jenkins pipeline, so as to solve the problems of high pipeline learning cost and difficult pipeline management that are currently common in the prior art when using Jenkins.
[0005] In a first aspect, the present invention provides a method for realizing dynamic creation of Jenkins pipelines, comprising: in response to a selection operation of a developer, determining a target pipeline template that meets the requirements of a Jenkins project from a version control system; wherein the version control system includes a plurality of pipeline templates pre-set by an administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including parameters and pipeline script fragments required for the task; in response to a configuration operation of a developer, configuring parameters of the task template in the target pipeline template according to the requirements of the Jenkins project; utilizing a pre-set Jenkins plug-in to intercept a build request before the project build phase, downloading the configured target pipeline template from the version control system, and generating a pipeline script.
[0006] According to the method for realizing dynamic creation of Jenkins pipeline provided by the present invention, the steps of constructing pipeline template include: using pipeline management platform to create the structure of pipeline template and corresponding task template; defining the parameters of task template and pipeline script fragment, as well as the dependency relationship between task templates; uploading the created pipeline template to the version control system.
[0007] The method for implementing dynamic creation of a Jenkins pipeline provided by the present invention also includes: performing version management and backup of the pipeline module through a version control system.
[0008] According to the method for implementing dynamic creation of Jenkins pipelines provided by the present invention, the version control system includes a GitLab tool.
[0009] According to the method for realizing dynamic creation of Jenkins pipeline provided by the present invention, after generating the pipeline script, it also includes: executing the pipeline script after the developer manually triggers the pipeline; wherein the generation step of the pipeline script includes: according to the parameter configuration of the task template, splicing the pipeline script fragments in sequence to generate a complete pipeline script.
[0010] According to the method for realizing dynamic creation of Jenkins pipeline provided by the present invention, after executing the pipeline script, it also includes: regularly counting the execution indicators of the pipeline script to optimize the pipeline template; wherein the execution indicators include: execution time and build success rate.
[0011] In a second aspect, the present invention further provides a device for implementing dynamic creation of a Jenkins pipeline, comprising:
[0012] The target pipeline template selection module is used to respond to the developer's selection operation and determine the target pipeline template that meets the Jenkins project requirements from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment;
[0013] The target pipeline template configuration module is used to respond to the developer's configuration operation and configure the parameters of the task template in the target pipeline template according to the Jenkins project requirements;
[0014] The pipeline script generation module is used to use the pre-set Jenkins plug-in to intercept the build request before the project build phase, download the configured target pipeline template from the version control system, and generate the pipeline script.
[0015] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described methods for dynamically creating a Jenkins pipeline are implemented.
[0016] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for dynamically creating a Jenkins pipeline.
[0017] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-described methods for implementing dynamic creation of a Jenkins pipeline.
[0018] The present invention provides a method and device for realizing dynamic creation of a Jenkins pipeline, which has the following beneficial effects compared with the prior art:
[0019] (1) Reduce learning costs: By introducing pipeline templates, project team members do not need to have an in-depth understanding of complex Jenkins pipeline script writing. They only need to perform simple parameter configuration according to project requirements to create a pipeline suitable for their own project.
[0020] (2) Improve management efficiency: By centrally managing pipeline templates, administrators can uniformly update and optimize templates to ensure consistency and standardization of all project pipelines, simplifying the Pipeline management process.
[0021] (3) Enhance maintainability and stability: Use version control systems such as Gitlab to manage the pipeline templates, which can trace the change history, avoid disorderly modifications, and improve the maintainability and stability of the pipeline.
[0022] (4) Improve project delivery speed: The automated pipeline creation function reduces manual intervention and speeds up the project construction and deployment process, thereby improving the efficiency of enterprise DevOps promotion.
[0023] (5) Reduce errors and improve reliability: The Jenkins plug-in automates the assembly of pipeline scripts, reducing human errors and improving the accuracy and stability of the pipeline.
[0024] (6) Improve build and deployment efficiency: The build and deployment efficiency of the project is improved through the reuse of pipeline templates and automated processes.
[0025] (7) Reduce maintenance difficulty: Due to the unified management and automated update of assembly line templates, the difficulty and cost of subsequent maintenance are reduced.
[0026] (8) Optimizing resource utilization: Automated assembly lines reduce dependence on human resources, allowing companies to use existing resources more effectively and improve resource utilization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 It is one of the flow diagrams of the method for realizing dynamic creation of Jenkins pipeline provided by the present invention;
[0029] Figure 2 This is the second flow chart of the method for realizing dynamic creation of Jenkins pipeline provided by the present invention;
[0030] Figure 3 It is a structural schematic diagram of a device for realizing dynamic creation of a Jenkins pipeline provided by the present invention;
[0031] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0034] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0035] In order to explain the technical solution of the present invention, the professional terms used in the present invention are first introduced.
[0036] DevOps: (a combination of Development and Operations) is a collective name for a set of processes, methods and systems that promote communication, collaboration and integration between development (application / software engineering), technical operations and quality assurance (QA) departments. It is a culture, movement or practice that emphasizes communication and cooperation between "software developers (Dev)" and "IT operations and maintenance technicians (Ops)". By automating the processes of "software delivery" and "architecture changes", it makes building, testing and releasing software faster, more frequent and more reliable.
[0037] GitLab: An open source project for warehouse management systems, using Git as a code management tool and building a web service on this basis. Gitlab is a widely used open source code management platform based on git, built on Ruby on Rails, and mainly manages the code and documents generated during software development.
[0038] Jenkins: An open source software project, a continuous integration tool developed based on Java, used to monitor continuous repetitive work, aims to provide an open and easy-to-use software platform that enables continuous integration of software projects.
[0039] Jenkins-Pipeline: refers to the process of building, testing and deploying software applications through a series of continuous automated steps in the continuous integration and continuous delivery (CI / CD) tool Jenkins. The concept of pipeline is to connect tasks that originally run independently on a single or multiple nodes to form a pipeline, making the software development and delivery process more efficient and reliable.
[0040] Combine the following Figure 1-Figure 4 The present invention describes a method and device for dynamically creating a Jenkins pipeline provided by an embodiment of the present invention.
[0041] Figure 1This is one of the flow charts of the method for realizing dynamic creation of Jenkins pipeline provided by the present invention, such as Figure 1 As shown, including but not limited to the following steps:
[0042] Step 101: In response to the developer's selection operation, a target pipeline template that meets the Jenkins project requirements is determined from the version control system; wherein the version control system includes a variety of pipeline templates pre-set by the administrator; the pipeline template includes multiple task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment.
[0043] This step allows developers to select a template that suits the needs of the current Jenkins project from a variety of preset pipeline templates. These templates are usually prepared in advance by system administrators or senior developers and stored in the version control system.
[0044] Developers (ordinary developers) can select templates through a graphical interface or command line interface. The system will check the template list in the version control system and display it to the user for selection.
[0045] Step 102: In response to the configuration operation of the developer, parameters of the task template in the target pipeline template are configured according to the Jenkins project requirements.
[0046] Once a suitable pipeline template is selected, developers can configure each task in the template in detail according to the needs of the actual project, such as specifying the build environment, setting build parameters, etc.
[0047] Step 103: Use the pre-set Jenkins plug-in to intercept the build request before the project build phase, download the configured target pipeline template from the version control system, and generate the pipeline script.
[0048] The Jenkins plugin can listen to build requests, and once a request is received, it automatically executes the process of downloading and generating pipeline scripts. The generated pipeline scripts can be directly used for Jenkins Pipeline execution.
[0049] Based on the content of the above embodiment, as an optional embodiment, the present invention provides a method for implementing dynamic creation of a Jenkins pipeline, and the steps of constructing a pipeline template include:
[0050] (1) Use the pipeline management platform to create the structure of pipeline templates and corresponding task templates.
[0051] Through the pipeline management platform (such as Jenkins itself or a third-party tool), design a template structure that defines the overall process of the pipeline and the tasks of each stage. Each task can be regarded as a node of the pipeline, responsible for performing specific build, test or deployment operations.
[0052] (2) Define the parameters of the task template and the pipeline script fragment, as well as the dependencies between task templates.
[0053] Define the necessary input parameters in the task template, such as build environment variables, build numbers, etc. At the same time, write or reference specific pipeline script fragments that implement the core logic of the task. In this way, you can easily adjust the behavior of the task without rewriting the entire script, even in different projects.
[0054] Clearly indicate which tasks must be executed before other tasks and which tasks can run in parallel. This usually involves defining the order or conditional branches between tasks to ensure that the pipeline can run stably and reliably.
[0055] (3) Upload the created pipeline template to the version control system.
[0056] Submit the pipeline template and its related files (such as task templates, script snippets, etc.) to a version control system (such as GitLab). It is recommended to use appropriate branch strategies and tags to manage different versions of templates.
[0057] It is understandable that the present invention can perform version management and backup of pipeline modules through a version control system.
[0058] Through the above steps, the present invention can construct flexible and stable pipeline templates, which can not only meet the needs of the current project, but also be easy to expand and maintain. Using a version control system to manage pipeline templates can also promote collaboration among team members and ensure the quality and consistency of the pipeline. This method provides strong support for the DevOps practice of enterprises and helps to improve the efficiency of software development and product quality.
[0059] After the pipeline script is generated, it also includes: after the developer manually triggers the pipeline, the pipeline script is executed; wherein, the generation step of the pipeline script includes: according to the parameter configuration of the task template, the pipeline script fragments are spliced in sequence to generate a complete pipeline script.
[0060] Developers can manually trigger the execution of the pipeline through the Jenkins user interface or API. After receiving the build request, Jenkins first loads the generated pipeline script. According to the definition in the pipeline script, each task is executed in sequence.
[0061] The steps of generating a pipeline script include: After selecting a pipeline template, the developer enters various parameters required by the task template through a graphical interface or configuration file. These parameters may include the build environment, build number, test environment, deployment target, etc. The script fragments of each task template are spliced into a complete pipeline script in the defined order.
[0062] After executing the pipeline script, the present invention further includes: regularly counting execution indicators of the pipeline script to optimize the pipeline template; wherein the execution indicators include: execution time and construction success rate.
[0063] Figure 2 This is a flow chart of the method for realizing dynamic creation of Jenkins pipeline provided by the present invention. As an optional embodiment, the following is combined with the attached Figure 2 The specific embodiments of the present invention are further described in detail.
[0064] S1 Determine requirements and process design:
[0065] Communicate in depth with relevant departments of the enterprise (such as development team, operation and maintenance team) to understand the problems and needs they encounter when using Jenkins, and clarify the pain points to be solved. Design the structure of pipeline templates and task templates, define the parameters and pipeline script fragments required by each task template, and the dependencies between task templates.
[0066] S2 creates pipeline templates and task templates:
[0067] Based on the preliminary design, the operation and maintenance administrator uses Jenkins or other pipeline management platforms to create pipeline templates and corresponding task templates. In the task template, write pipeline script fragments and specify variables that can be automatically obtained and exported, and determine which parameters need to be entered by the user when the pipeline is created to maintain flexibility.
[0068] The present invention introduces the concept of pipeline templates, encapsulates the construction logic into several task templates, and further realizes the modularization and reuse of pipelines. The operation and maintenance administrator can write commonly used pipeline task templates according to the project situation of the enterprise, and arrange and combine them into commonly used pipeline templates according to project requirements. This templated design helps to uniformly manage the construction logic of the pipeline, so that the pipelines between different projects remain consistent, and also facilitates subsequent maintenance and upgrades.
[0069] S3 configuration version control system:
[0070] Upload the designed pipeline templates and task templates to GitLab or other version control systems for version management and backup.
[0071] In order to ensure the consistency and continuous optimization of the pipeline template, the present invention manages the pipeline template in the form of version management. The administrator user can store the written task template and pipeline template in the version warehouse (such as Gitlab), which is convenient for team member collaboration and version control. In the pipeline creation process, ordinary users can choose the pipeline template suitable for their own projects, and fill in parameters as required, and the template in the version warehouse ensures the timely update and upgrade of the template. This version management method ensures that the pipeline of the enterprise always adopts the latest improvements and best practices, and improves the efficiency and stability of the pipeline.
[0072] S4 transforms the project:
[0073] Developers make modifications in the project code repository according to the selected pipeline template requirements. As needed, add Jenkinsfile and related configuration files, and add Dockerfile, Kubernetes YAML files, startup files and other files for building and deployment in the project.
[0074] S5 Integration with Jenkins and GitLab:
[0075] Integrate Jenkins with GitLab to ensure that Jenkins can easily access the pipeline templates in GitLab.
[0076] S6 creates a Jenkins project and configures the pipeline:
[0077] Create a new project in Jenkins and configure the pipeline execution mode. In the pipeline configuration, select the corresponding pipeline template on GitLab and associate it with the Jenkinsfile in the project.
[0078] S7 ordinary users create pipelines:
[0079] Ordinary developers select the pipeline template suitable for their own projects based on the pipeline template in Gitlab, and fill in the relevant parameters according to the template requirements.
[0080] S8 Jenkins integrated pipeline plugin:
[0081] A special Jenkins plug-in has been developed, which intercepts before the Jenkins build phase. Once the project needs to be built, the plug-in will download the pre-defined pipeline template file from GitLab. Then, according to the project configuration information, the plug-in flexibly assembles a complete pipeline script.
[0082] The present invention introduces a method for dynamically assembling Jenkins Pipeline by developing a dedicated Jenkins plug-in, which fundamentally solves the problem that Jenkins Pipeline cannot be effectively and uniformly managed in an enterprise. The plug-in intercepts before the construction link of Jenkins, realizes the automatic acquisition of pipeline templates and the flexible assembly of complete pipeline scripts according to project configuration. This innovative plug-in design makes the creation and management process of the pipeline automatic and intelligent, greatly reduces the learning cost, improves the robustness of the pipeline, and simplifies the upgrade and maintenance process.
[0083] S9Jenkins pipeline execution:
[0084] Jenkins automatically detects code changes or the user manually triggers the pipeline and executes the pipeline. Jenkins executes each task in sequence according to the execution order of the pipeline script fragments, such as cloning code, building images, running tests, etc. The execution results will be fed back to the development team in real time, including build status, deployment results, and possible errors or warnings.
[0085] S10 statistics and optimizations:
[0086] Regularly collect statistics on pipeline execution time, efficiency, and build success rate to optimize pipeline performance and stability. Based on data analysis results, the team can continuously improve pipeline templates and configurations, improve project building and deployment efficiency, and reduce learning costs and management difficulties.
[0087] In summary, the present invention solves the problem that Jenkins Pipeline cannot be effectively and uniformly managed in enterprises by developing a Jenkins plug-in and dynamically assembling Jenkins Pipeline, and introduces the concept of pipeline templates and version management methods to solve challenges such as high learning cost, lack of robustness, and difficulty in upgrading and maintenance. These innovative technical solutions enable enterprises to build and manage pipelines more efficiently, improving the efficiency and promotion of DevOps practices.
[0088] Figure 3 Schematic diagram of the structure of the device for realizing dynamic creation of Jenkins pipeline provided by the present invention, such as Figure 3 As shown, the device comprises:
[0089] The target pipeline template selection module 310 is used to determine the target pipeline template that meets the Jenkins project requirements from the version control system in response to the developer's selection operation; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment;
[0090] The target pipeline template configuration module 320 is used to respond to the configuration operation of the developer and configure the parameters of the task template in the target pipeline template according to the Jenkins project requirements;
[0091] The pipeline script generation module 330 is used to intercept the build request before the project build phase by using the pre-set Jenkins plug-in, download the configured target pipeline template from the version control system, and generate a pipeline script.
[0092] It should be noted that the device for implementing dynamic creation of a Jenkins pipeline provided in an embodiment of the present invention can execute the method for implementing dynamic creation of a Jenkins pipeline described in any of the above embodiments during specific operation, which will not be described in detail in this embodiment.
[0093] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a method for dynamically creating a Jenkins pipeline, the method comprising: in response to the selection operation of the developer, determining a target pipeline template that meets the requirements of the Jenkins project from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters and pipeline script fragments required for the task; in response to the configuration operation of the developer, the task template in the target pipeline template is parameterized according to the requirements of the Jenkins project; using the pre-set Jenkins plug-in, the build request is intercepted before the project build link, the configured target pipeline template is downloaded from the version control system, and the pipeline script is generated.
[0094] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the method for realizing dynamic creation of Jenkins pipelines provided by the above-mentioned embodiments, the method including: in response to the selection operation of the developer, determining a target pipeline template that meets the requirements of the Jenkins project from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment; in response to the configuration operation of the developer, the task template in the target pipeline template is parameterized according to the requirements of the Jenkins project; using the pre-set Jenkins plug-in, intercepting the build request before the project build phase, downloading the configured target pipeline template from the version control system, and generating a pipeline script.
[0095] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method for implementing dynamic creation of Jenkins pipelines provided in the above-mentioned embodiments, the method comprising: in response to the selection operation of the developer, determining a target pipeline template that meets the requirements of the Jenkins project from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment; in response to the configuration operation of the developer, the task template in the target pipeline template is parameterized according to the requirements of the Jenkins project; using the pre-set Jenkins plug-in, intercepting the build request before the project build phase, downloading the configured target pipeline template from the version control system, and generating a pipeline script.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dynamically creating a Jenkins pipeline, characterized in that: include: In response to the developer's selection operation, a target pipeline template that meets the Jenkins project requirements is determined from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment; In response to the developer's configuration operation, the task template in the target pipeline template is configured with parameters according to the Jenkins project requirements; Utilize the pre-set Jenkins plug-in to intercept the build request before the project build phase, download the configured target pipeline template from the version control system, and generate the pipeline script.
2. The method for implementing dynamic creation of Jenkins pipeline according to claim 1, characterized in that: The steps to build a pipeline template include: Use the pipeline management platform to create the structure of pipeline templates and corresponding task templates; Define the parameters and pipeline script snippets of task templates, as well as the dependencies between task templates; Upload the created pipeline template to the version control system.
3. The method for implementing dynamic creation of Jenkins pipeline according to claim 1, characterized in that: Also includes: The pipeline modules are version managed and backed up through the version control system.
4. The method for implementing dynamic creation of Jenkins pipeline according to claim 1, characterized in that: Version control systems include the GitLab tool.
5. The method for implementing dynamic creation of Jenkins pipeline according to claim 1, characterized in that: Also include after generating the pipeline script: After the developer manually triggers the pipeline, the pipeline script is executed; The steps for generating the pipeline script include: According to the parameter configuration of the task template, the pipeline script fragments are spliced in sequence to generate a complete pipeline script.
6. The method for implementing dynamic creation of Jenkins pipeline according to claim 1, characterized in that: After executing the pipeline script, it also includes: Regularly count the execution indicators of the pipeline script to optimize the pipeline template; Among them, execution indicators include: execution time and build success rate.
7. A device for implementing dynamic creation of Jenkins pipeline, characterized in that: include: The target pipeline template selection module is used to respond to the developer's selection operation and determine the target pipeline template that meets the Jenkins project requirements from the version control system; wherein the version control system includes a plurality of pipeline templates pre-set by the administrator; the pipeline template includes a plurality of task templates, and the task template is used to describe the execution process of a specific task, including the parameters required for the task and the pipeline script fragment; The target pipeline template configuration module is used to respond to the developer's configuration operation and configure the parameters of the task template in the target pipeline template according to the Jenkins project requirements; The pipeline script generation module is used to use the pre-set Jenkins plug-in to intercept the build request before the project build phase, download the configured target pipeline template from the version control system, and generate the pipeline script.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for dynamically creating a Jenkins pipeline as described in any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically creating a Jenkins pipeline as described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for dynamically creating a Jenkins pipeline as described in any one of claims 1 to 6 are implemented.