CN110096304A - Task construction method, device, equipment and storage medium based on Jenkins - Google Patents

Task construction method, device, equipment and storage medium based on Jenkins Download PDF

Info

Publication number
CN110096304A
CN110096304A CN201910200481.3A CN201910200481A CN110096304A CN 110096304 A CN110096304 A CN 110096304A CN 201910200481 A CN201910200481 A CN 201910200481A CN 110096304 A CN110096304 A CN 110096304A
Authority
CN
China
Prior art keywords
task
jenkins
target
goal
jenkinsfile
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910200481.3A
Other languages
Chinese (zh)
Inventor
杜亚明
王飞
刘超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Urban Construction Technology Shenzhen Co Ltd
Original Assignee
Ping An Urban Construction Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Urban Construction Technology Shenzhen Co Ltd filed Critical Ping An Urban Construction Technology Shenzhen Co Ltd
Priority to CN201910200481.3A priority Critical patent/CN110096304A/en
Publication of CN110096304A publication Critical patent/CN110096304A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention provides a kind of task construction method, device, equipment and storage medium based on Jenkins, i.e. when detecting that code storage changes, the change list in the code storage is obtained, and is judged in the change list with the presence or absence of the corresponding building file jenkinsFile of goal task;The jenkinsFile if it exists then obtains the task type parameter in the jenkinsFile, and according to the task type parameter, determines the target constructed type of the goal task;The target flow file in the jenkinsFile is obtained, and according to the target flow file and target constructed type, constructs the goal task.JenkinsFile in change data of the present invention by obtaining code storage, then obtains the customized target flow file of user in the jenkinsFile, and construct goal task automatically according to the target flow file.By the above-mentioned means, realizing issuing process optimization, building operation is not only simplified, and improve building efficiency.

Description

Task construction method, device, equipment and storage medium based on Jenkins
Technical field
The present invention relates to field of computer technology more particularly to a kind of task construction method based on Jenkins, device, Equipment and computer readable storage medium.
Background technique
Continuous integrating (Continuous integration, CI) be exactly in the software project development stage, continually will more Fresh code is integrated into main-line program.After developer submits the code for updating point, constructed at once (compiling be packaged) and First round test judges that can update point code and trunk code correctly integrate according to test result, to help Developer quickly has found mistake, enables product iteratively faster, while guaranteeing the high quality of product.Jenkins is common One of the build tool.It when constructing task, needs to complete a large amount of configuration work in advance by using jenkins, such as configures structure Build the node of task, write building script or add construction step etc..Existing Jenkins building task needs developer It is configured manually, it is not only cumbersome, a large amount of manpowers are wasted, and construct inefficiency.
Therefore, how to solve existing cumbersome and building inefficiency by constructing for Jenkins building task The problem of problem is current urgent need to resolve.
Summary of the invention
The main purpose of the present invention is to provide a kind of task construction method, device, equipment and calculating based on Jenkins Machine readable storage medium storing program for executing, it is intended to solve it is existing by Jenkins construct task building it is cumbersome and building inefficiency The technical issues of.
To achieve the above object, the present invention provides a kind of task construction method based on Jenkins, described to be based on The task construction method of Jenkins the following steps are included:
When detecting that code storage changes, the change list in the code storage is obtained, and described in judgement It changes and whether there is the corresponding building file jenkinsFile of goal task in list;
The jenkinsFile if it exists then obtains the task type parameter in the jenkinsFile, and according to institute Task type parameter is stated, determines the target constructed type of the goal task;
The target flow file in the jenkinsFile is obtained, and according to the target flow file and target structure Type is built, the goal task is constructed.
Optionally, the target flow file obtained in the jenkinsFile, and according to the target flow file And target constructed type, the step of constructing the goal task, include:
The target flow file in the jenkinsFile is obtained, and the mesh is determined according to the target flow file The corresponding goal systems resource of mark task, target plug-in and construction step;
Based on the target constructed type, and according to the goal systems resource, target plug-in and construction step, building The goal task.
Optionally, the target plug-in includes Jenkins plug-in unit, described to be based on the target constructed type, and according to institute The step of stating goal systems resource, target plug-in and construction step, constructing the goal task specifically includes:
Judge in current system environment with the presence or absence of the goal systems resource;
If there are the goal systems resource in the current system environment, according to the construction step, described in calling Jenkins plug-in unit obtains the goal systems resource, to construct the corresponding goal task of the target constructed type.
Optionally, it if there are the goal systems resources in the current system environment, is walked according to the building Suddenly, the Jenkins plug-in unit is called, the goal systems resource is obtained, to construct the corresponding target of the target constructed type The step of task, specifically includes:
If judging to whether there is in current system plug-in unit there are the goal systems resource in the current system environment The Jenkins plug-in unit;
The Jenkins plug-in unit if it exists calls the Jenkins plug-in unit then according to the construction step, described in acquisition Goal systems resource, to construct the corresponding goal task of the target constructed type;
The Jenkins plug-in unit if it does not exist is downloaded and is installed then according to the download address in the jenkinsFile The Jenkins plug-in unit;
According to the construction step, the Jenkins plug-in unit is called, obtains the goal systems resource, described in building The corresponding goal task of target constructed type.
Optionally, the target flow file obtained in the jenkinsFile, and according to the target flow file And target constructed type, the step of constructing the goal task, specifically include:
Judge whether the target constructed type is to delete type;
If the target constructed type is not the deletion type, according to the construction step, invocation target plug-in unit, newly The goal task is built or updates, and by the goal systems resource carry to Jenkins host, to construct the target The goal task is run after task.
Optionally, it is described judge the target constructed type whether be delete type the step of after, further includes:
If the target constructed type is to delete type, the goal task mark in the jenkinsFile is obtained;
It is identified according to the goal task, obtains the corresponding related data of the goal task in the change list, And the corresponding related data of the goal task is deleted, to delete the goal task.
Optionally, described when detecting that code storage changes, the change list in the code storage is obtained, And after the step of judging building file jenkinsFile corresponding with the presence or absence of goal task in the change list, also wrap It includes:
The jenkinsFile if it does not exist then determines without constructing task, and whether monitors the code storage again It changes.
In addition, to achieve the above object, the present invention also provides a kind of task construction device based on Jenkins, the base Include: in the task construction device of Jenkins
File judgment module, for when detecting that code storage changes, obtaining the change in the code storage More list, and judge in the change list with the presence or absence of the corresponding building file jenkinsFile of goal task;
Determination type module then obtains the task in the jenkinsFile for the jenkinsFile if it exists Type parameter, and according to the task type parameter, determine the target constructed type of the goal task;
Task constructs module, for obtaining the target flow file in the jenkinsFile, and according to the target stream Journey file and target constructed type, construct the goal task.
In addition, to achieve the above object, the present invention also provides a kind of, and the task based on Jenkins constructs equipment, the base Include processor, memory and be stored on the memory and can be by the processing in the task building equipment of Jenkins The task construction procedures based on Jenkins that device executes, wherein the task construction procedures based on Jenkins are by the processing When device executes, realize such as the step of the above-mentioned task construction method based on Jenkins.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium The task construction procedures based on Jenkins are stored on storage medium, wherein the task construction procedures quilt based on Jenkins When processor executes, realize such as the step of the above-mentioned task construction method based on Jenkins.
The present invention provides a kind of task construction method based on Jenkins, that is, is detecting that code storage changes When, the change list in the code storage is obtained, and judge in the change list with the presence or absence of the corresponding structure of goal task Build file jenkinsFile;The jenkinsFile if it exists then obtains the task type ginseng in the jenkinsFile Number, and according to the task type parameter, determine the target constructed type of the goal task;Obtain the jenkinsFile In target flow file construct the goal task and according to the target flow file and target constructed type.Pass through Aforesaid way, the jenkinsFile in change data that the present invention passes through acquisition code storage, then described in acquisition The customized target flow file of user in jenkinsFile, and goal task is constructed automatically according to the target flow file. Building operation is not only simplified, and improves building efficiency, the existing building that task is constructed by Jenkins is solved and operates The technical issues of cumbersome and building inefficiency.
Detailed description of the invention
Fig. 1 is the hardware configuration signal of the task building equipment involved in the embodiment of the present invention based on Jenkins Figure;
Fig. 2 is that the present invention is based on the flow diagrams of the task construction method first embodiment of Jenkins;
Fig. 3 is that the present invention is based on the flow diagrams of the task construction method second embodiment of Jenkins;
Fig. 4 is that the present invention is based on the flow diagrams of the task construction method 3rd embodiment of Jenkins;
Fig. 5 is that the present invention is based on the functional block diagrams of the task construction device first embodiment of Jenkins.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present embodiments relate to the task construction method based on Jenkins be mainly used in based on Jenkins appoint Business building equipment, should can be PC, portable computer, mobile terminal etc. based on the task building equipment of Jenkins has display With the equipment of processing function.
Referring to Fig.1, Fig. 1 is the hardware of the task building equipment involved in the embodiment of the present invention based on Jenkins Structural schematic diagram.In the embodiment of the present invention, task based on Jenkins building equipment may include processor 1001 (such as CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is used for Realize the connection communication between these components;User interface 1003 may include display screen (Display), input unit such as key Disk (Keyboard);Network interface 1004 optionally may include standard wireline interface and wireless interface (such as WI-FI interface); Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatilememory), such as magnetic Disk storage, memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that hardware configuration shown in Fig. 1 is not constituted to the task based on Jenkins The restriction for constructing equipment may include perhaps combining certain components or different components than illustrating more or fewer components Arrangement.
With continued reference to Fig. 1, the memory 1005 in Fig. 1 as a kind of computer readable storage medium may include operation system System, network communication module and the task construction procedures based on Jenkins.
In Fig. 1, network communication module is mainly used for connecting server, carries out data communication with server;And processor 1001 can call the task construction procedures based on Jenkins stored in memory 1005, and execute the embodiment of the present invention and mention The task construction method based on Jenkins supplied.
The embodiment of the invention provides a kind of task construction method based on Jenkins.
It is that the present invention is based on the flow diagrams of the task construction method first embodiment of Jenkins referring to Fig. 2, Fig. 2.
In the present embodiment, the task construction method based on Jenkins the following steps are included:
Step S10 obtains the change list in the code storage when detecting that code storage changes, and Judge in the change list with the presence or absence of the corresponding building file jenkinsFile of goal task;
In the present embodiment, in order to solve it is existing by Jenkins construct task building it is cumbersome and building efficiency Low technical problem, the present invention provide a kind of task construction method based on Jenkins, applied to appointing based on Jenkins Business construction platform.The task construction platform based on Jenkins is monitored by change to code storage, can be automatically performed pair The configuration work of jenkins-pipeline.Whole process is not necessarily to operation maintenance personnel intervention completely.When developer is submitted to code In the change in warehouse, when containing the modification to jenkinsFile, system actively monitors the change.Simultaneously according to setting in advance The configuration template set is automatically performed to attended operations such as the newly-built of jenkins-pipeline building task, deletion, updates.With Corresponding code file can be uploaded to code storage by family, and server obtains the generation when detecting that code storage changes The change data in code warehouse, and according to the change list in the change data, judge to whether there is in change file JenkinsFile file.The jenkinsFile file if it exists, the i.e. current operation of expression user are task building operation.
Step S20, the jenkinsFile, then obtain the task type parameter in the jenkinsFile if it exists, And according to the task type parameter, the target constructed type of the goal task is determined;
In the present embodiment, the jenkinsFile file, then obtain the behaviour in the jenkinsFile file if it exists Make method parameter, the action type of the container building operation is then determined according to the operating method parameter, such as creates, delete The attended operations type such as remove, update.
Further, after the step S10, further includes:
The jenkinsFile if it does not exist then determines without constructing task, and whether monitors the code storage again It changes.
In the present embodiment, if the jenkinsFile file is not present in the change data, i.e., expression user's is current Operation only relates to the maintenance modification of code word, uncorrelated to same period building operation, there is no need to carry out the building of inter-related task, and Again the change of the code storage is monitored.
Step S30, obtains the target flow file in the jenkinsFile, and according to the target flow file with And target constructed type, construct the goal task.
In the present embodiment, the target flow file in the jenkinsFile file is obtained, wherein the target process File is the customized task building process of user, such as newly-built process, changing process or deletion process.The task structure The target component that process may include compiling to be packaged is built, such as container start-up parameter and other resource parameters.For example, if described Target constructed type is newly-built, the then concrete operations of newly-built task are as follows: obtain the container Docker in the target flow file Start-up parameter, the start-up parameter of container Docker be it is pre-configured by user, can be according to different specific requirements Carry out flexible configuration.It in the present embodiment, include code downloading ground needed for generating Docker mirror image in the start-up parameter of container Location, code compilation instruction with Dockerfile the file information etc., so, from the start-up parameter, can directly determine birth at Determination code download address needed for Docker mirror image, code compilation instruction and Dockerfile file.Then according to the generation Code download address, download application code;The code compilation instruction is executed, the code compilation instruction is described for compiling Application code simultaneously generates compiling destination file;According to the Dockerfile file and the compiling destination file, generate Docker mirror image.From the start-up parameter, mirror image warehouse information is determined;It, will be described according to the mirror image warehouse information Docker mirror image is uploaded to corresponding mirror image warehouse.Wherein, Docker mirror image generation method provided by the embodiment, by generation Docker mirror image is uploaded to corresponding mirror image warehouse, in order to the centralized management of Docker mirror image, and user is made to pass through host The Docker mirror image can be downloaded from mirror image warehouse.
The present embodiment provides a kind of task construction method based on Jenkins is detecting that code storage becomes When more, the change list in the code storage is obtained, and is judged corresponding with the presence or absence of goal task in the change list Construct file jenkinsFile;The jenkinsFile if it exists then obtains the task type ginseng in the jenkinsFile Number, and according to the task type parameter, determine the target constructed type of the goal task;Obtain the jenkinsFile In target flow file construct the goal task and according to the target flow file and target constructed type.Pass through Aforesaid way, the jenkinsFile in change data that the present invention passes through acquisition code storage, then described in acquisition The customized target flow file of user in jenkinsFile, and goal task is constructed automatically according to the target flow file. Building operation is not only simplified, and improves building efficiency, the existing building that task is constructed by Jenkins is solved and operates The technical issues of cumbersome and building inefficiency.
It is that the present invention is based on the flow diagrams of the task construction method second embodiment of Jenkins referring to Fig. 3, Fig. 3.
Based on above-mentioned embodiment illustrated in fig. 2, in the present embodiment, the step S30 is specifically included:
Step S31 obtains the target flow file in the jenkinsFile, and true according to the target flow file Determine the corresponding goal systems resource of the goal task, target plug-in and construction step;
It include goal systems resource, target needed for the goal task in the target flow file in the present embodiment Plug-in unit and construction step.The goal systems resource includes: machine type, machine specifications and the institute that the building task is relied on Rely on operating system;The target plug-in is used to illustrate the software and Jenkins plug-in unit that the building task is relied on;The structure Step is built for defining the building process of the building task, can also include the triggered time of construction step.
Step S32 is based on the target constructed type, and according to the goal systems resource, target plug-in and building Step constructs the goal task.
In the present embodiment, the task construction platform based on Jenkins configures and the target system from current system environment The system resource that system resource matches.Then according to the target plug-in, the building task is configured in current system environment The target software and target Jenkins plug-in unit relied on;According to described and construction step, building goal task is sequentially generated.
By the above-mentioned means, the task construction platform based on Jenkins can be according to the target process text that developer writes Part, automatically configures the system resource (system environments) of operation building required by task, and is automatically mounted to the system resource On Jenkins host.Then according to the target plug-in in target flow file, automatically configure software that building task is relied on and Jenkins plug-in unit, and automatically create Jenkins building task.It is automatic that whole process by system automatically parses jenkinsFile The configuration and creation for completing building task are manually operated without user, easy to operate, high-efficient.
Further, the target plug-in includes Jenkins plug-in unit, and the step S32 is specifically included:
Judge in current system environment with the presence or absence of the goal systems resource;
If there are the goal systems resource in the current system environment, according to the construction step, described in calling Jenkins plug-in unit obtains the goal systems resource, to construct the corresponding goal task of the target constructed type.
In the present embodiment, the concrete operations for the system resource that configuration matches with the goal systems resource are as follows: search institute It states in current system environment with the presence or absence of the goal systems resource;If there are the target systems in the current system environment Unite resource, then execute according to the target plug-in, configured in current system environment software that the building task is relied on and Jenkins plug-in unit;If the goal systems resource is not present in the current system environment, the goal systems money is created Source, then execute configured in current system environment according to the target plug-in software that the building task is relied on and Jenkins plug-in unit.
Further, if there are the goal systems resources in the current system environment, according to the building Step calls the Jenkins plug-in unit, obtains the goal systems resource, to construct the corresponding mesh of the target constructed type Mark task specifically includes:
If judging to whether there is in current system plug-in unit there are the goal systems resource in the current system environment The Jenkins plug-in unit;
The Jenkins plug-in unit if it exists calls the Jenkins plug-in unit then according to the construction step, described in acquisition Goal systems resource, to construct the corresponding goal task of the target constructed type;
The Jenkins plug-in unit if it does not exist is downloaded and is installed then according to the download address in the jenkinsFile The Jenkins plug-in unit;
According to the construction step, the Jenkins plug-in unit is called, obtains the goal systems resource, described in building The corresponding goal task of target constructed type.
In the present embodiment, the Jenkins plug-in unit is called to specifically include: searching and whether installed in current operation system State Jenkins tool;If the Jenkins tool is not installed in the current operation system, according to The download address for the Jenkins tool for including in jenkinsFile obtains the Jenkins tool, and described in installation Jenkins tool;If being equipped with the target plug-in in the current operation system, the Jenkins work is continued to search Whether the target Jenkins plug-in unit is installed in tool;If the target Jenkins is not installed in the Jenkins tool Plug-in unit then obtains the target according to the download address for the target Jenkins plug-in unit for including in the jenkinsFile Jenkins plug-in unit, and the target Jenkins plug-in unit is installed;If being equipped with the target in the Jenkins tool Jenkins plug-in unit, it is determined that the target software and the target Jenkins plug-in unit are equipped in the current system environment.
It is that the present invention is based on the flow diagrams of the task construction method 3rd embodiment of Jenkins referring to Fig. 4, Fig. 4.
Based on above-mentioned embodiment illustrated in fig. 3, in the present embodiment, the step S32 is specifically included:
Step S321 judges whether the target constructed type is to delete type;
In the present embodiment, the building task type includes: creation or the update goal task;Then by the target System resource is mounted on Jenkins host, to run the building task.The mesh is judged according to the task type parameter Whether mark constructed type deletes type.
Step S322, according to the construction step, calls mesh if the target constructed type is not the deletion type Plug-in unit is marked, create or updates the goal task, and by the goal systems resource carry to Jenkins host, in structure The goal task is run after building the goal task.
In the present embodiment, if the target constructed type is not to delete type, as newly-built or updating type.Obtain institute Goal systems resource, target plug-in and the construction step of jenkinsFile are stated, that is, is based on the goal systems resource, calls mesh Plug-in unit is marked, and according to the construction step, successively constructs the goal task.
Further, after the step S321, further includes:
If the target constructed type is to delete type, the goal task mark in the jenkinsFile is obtained;
It is identified according to the goal task, obtains the corresponding related data of the goal task in the change list, And the corresponding related data of the goal task is deleted, to delete the goal task.
In the present embodiment, the change of the code storage as described in real-time detection of the present invention, if the target constructed type Operation obtains the goal task mark in the jenkinsFile, i.e., the mark of task to be deleted, in the change to delete The corresponding related data of the goal task is obtained in more list, and deletes the corresponding related data of the goal task, to delete Except the goal task.
In addition, the embodiment of the present invention also provides a kind of task construction device based on Jenkins.
It is that the present invention is based on the signals of the functional module of the task construction device first embodiment of Jenkins referring to Fig. 5, Fig. 5 Figure.
In the present embodiment, the task construction device based on Jenkins includes:
File judgment module 10, for when detecting that code storage changes, obtaining in the code storage List is changed, and is judged in the change list with the presence or absence of the corresponding building file jenkinsFile of goal task;
Determination type module 20 then obtains appointing in the jenkinsFile for the jenkinsFile if it exists Service type parameter, and according to the task type parameter, determine the target constructed type of the goal task;
Task constructs module 30, for obtaining the target flow file in the jenkinsFile, and according to the target Flow file and target constructed type, construct the goal task.
Further, the file judgment module 10 is also used to:
The jenkinsFile if it does not exist then determines without constructing task, and whether monitors the code storage again It changes.
Further, the task building module 30 specifically includes:
Document analysis unit, for obtaining the target flow file in the jenkinsFile, and according to the target stream Journey file determines the corresponding goal systems resource of the goal task, target plug-in and construction step;
Task construction unit, for being based on the target constructed type, and according to the goal systems resource, target plug-in And construction step, construct the goal task.
Further, the task construction unit is also used to:
Judge in current system environment with the presence or absence of the goal systems resource;
If there are the goal systems resource in the current system environment, according to the construction step, described in calling Jenkins plug-in unit obtains the goal systems resource, to construct the corresponding goal task of the target constructed type.
Further, the task construction unit is also used to:
If judging to whether there is in current system plug-in unit there are the goal systems resource in the current system environment The Jenkins plug-in unit;
The Jenkins plug-in unit if it exists calls the Jenkins plug-in unit then according to the construction step, described in acquisition Goal systems resource, to construct the corresponding goal task of the target constructed type;
The Jenkins plug-in unit if it does not exist is downloaded and is installed then according to the download address in the jenkinsFile The Jenkins plug-in unit;
According to the construction step, the Jenkins plug-in unit is called, obtains the goal systems resource, described in building The corresponding goal task of target constructed type.
Further, the task construction unit specifically includes:
Type judging unit, for judging whether the target constructed type is to delete type;
Task constructs subelement, if not being the deletion type for the target constructed type, according to the building Step, invocation target plug-in unit is newly-built or update the goal task, and by the goal systems resource carry to Jenkins Host, to run the goal task after constructing the goal task.
Further, the task building subelement is also used to:
If the target constructed type is to delete type, the goal task mark in the jenkinsFile is obtained;
It is identified according to the goal task, obtains the corresponding related data of the goal task in the change list, And the corresponding related data of the goal task is deleted, to delete the goal task.
Wherein, modules and the above-mentioned task structure based on Jenkins in the above-mentioned task construction device based on Jenkins Each step is corresponding in construction method embodiment, and function and realization process no longer repeat one by one here.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium.
The task construction procedures based on Jenkins are stored on computer readable storage medium of the present invention, wherein the base When the task construction procedures of Jenkins are executed by processor, realize such as the above-mentioned task construction method based on Jenkins Step.
Wherein, the task construction procedures based on Jenkins be performed realized method can refer to the present invention is based on Each embodiment of the task construction method of Jenkins, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of task construction method based on Jenkins, which is characterized in that the task construction method based on Jenkins The following steps are included:
When detecting that code storage changes, the change list in the code storage is obtained, and judge the change It whether there is the corresponding building file jenkinsFile of goal task in list;
The jenkinsFile if it exists then obtains the task type parameter in the jenkinsFile, and according to described Service type parameter determines the target constructed type of the goal task;
The target flow file in the jenkinsFile is obtained, and class is constructed according to the target flow file and target Type constructs the goal task.
2. the task construction method based on Jenkins as described in claim 1, which is characterized in that described in the acquisition Target flow file in jenkinsFile, and according to the target flow file and target constructed type, construct the mesh The step of mark task includes:
The target flow file in the jenkinsFile is obtained, and determines that the target is appointed according to the target flow file It is engaged in corresponding goal systems resource, target plug-in and construction step;
Based on the target constructed type, and according to the goal systems resource, target plug-in and construction step, described in building Goal task.
3. the task construction method based on Jenkins as claimed in claim 2, which is characterized in that the target plug-in includes Jenkins plug-in unit, it is described to be based on the target constructed type, and according to the goal systems resource, target plug-in and building Step, the step of constructing the goal task, specifically include:
Judge in current system environment with the presence or absence of the goal systems resource;
If there are the goal systems resource in the current system environment, according to the construction step, described in calling Jenkins plug-in unit obtains the goal systems resource, to construct the corresponding goal task of the target constructed type.
4. the task construction method based on Jenkins as claimed in claim 3, which is characterized in that if the current system Uniting in environment, there are the goal systems resources, then according to the construction step, call the Jenkins plug-in unit, described in acquisition Goal systems resource is specifically included the step of the target constructed type corresponding goal task with constructing:
If judging in current system plug-in unit there are the goal systems resource in the current system environment with the presence or absence of described Jenkins plug-in unit;
The Jenkins plug-in unit if it exists calls the Jenkins plug-in unit, obtains the target then according to the construction step System resource, to construct the corresponding goal task of the target constructed type;
The Jenkins plug-in unit if it does not exist is downloaded and is installed described then according to the download address in the jenkinsFile Jenkins plug-in unit;
According to the construction step, the Jenkins plug-in unit is called, obtains the goal systems resource, to construct the target The corresponding goal task of constructed type.
5. the task construction method based on Jenkins as claimed in claim 2, which is characterized in that described in the acquisition Target flow file in jenkinsFile, and according to the target flow file and target constructed type, construct the mesh The step of mark task, specifically includes:
Judge whether the target constructed type is to delete type;
If the target constructed type is not the deletion type, according to the construction step, invocation target plug-in unit, create or Person updates the goal task, and by the goal systems resource carry to Jenkins host, to construct the goal task After run the goal task.
6. the task construction method based on Jenkins as claimed in claim 5, which is characterized in that the judgement target After the step of whether constructed type is deletion type, further includes:
If the target constructed type is to delete type, the goal task mark in the jenkinsFile is obtained;
It is identified according to the goal task, obtains the corresponding related data of the goal task in the change list, and delete Except the corresponding related data of the goal task, to delete the goal task.
7. the task construction method based on Jenkins as described in claim 1 to 6 any one, which is characterized in that it is described When detecting that code storage changes, the change list in the code storage is obtained, and is judged in the change list After the step of building file jenkinsFile corresponding with the presence or absence of goal task, further includes:
The jenkinsFile if it does not exist then determines without constructing task, and monitors whether the code storage occurs again Change.
8. a kind of task construction device based on Jenkins, which is characterized in that the task construction device based on Jenkins Include:
File judgment module, for when detecting that code storage changes, obtaining the column of the change in the code storage Table, and judge in the change list with the presence or absence of the corresponding building file jenkinsFile of goal task;
Determination type module then obtains the task type in the jenkinsFile for the jenkinsFile if it exists Parameter, and according to the task type parameter, determine the target constructed type of the goal task;
Task constructs module, for obtaining the target flow file in the jenkinsFile, and according to the target process text Part and target constructed type, construct the goal task.
9. a kind of task based on Jenkins constructs equipment, which is characterized in that the task based on Jenkins constructs equipment Including processor, memory and the appointing based on Jenkins that is stored on the memory and can be executed by the processor Business construction procedures, wherein realizing such as claim when the task construction procedures based on Jenkins are executed by the processor The step of task construction method described in any one of 1 to 7 based on Jenkins.
10. a kind of computer readable storage medium, which is characterized in that be stored with and be based on the computer readable storage medium The task construction procedures of Jenkins, wherein being realized such as when the task construction procedures based on Jenkins are executed by processor The step of task construction method described in any one of claims 1 to 7 based on Jenkins.
CN201910200481.3A 2019-03-16 2019-03-16 Task construction method, device, equipment and storage medium based on Jenkins Pending CN110096304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910200481.3A CN110096304A (en) 2019-03-16 2019-03-16 Task construction method, device, equipment and storage medium based on Jenkins

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910200481.3A CN110096304A (en) 2019-03-16 2019-03-16 Task construction method, device, equipment and storage medium based on Jenkins

Publications (1)

Publication Number Publication Date
CN110096304A true CN110096304A (en) 2019-08-06

Family

ID=67443264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910200481.3A Pending CN110096304A (en) 2019-03-16 2019-03-16 Task construction method, device, equipment and storage medium based on Jenkins

Country Status (1)

Country Link
CN (1) CN110096304A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338634A (en) * 2020-02-14 2020-06-26 香港乐蜜有限公司 Parallel construction method, device and equipment
CN111399814A (en) * 2020-03-09 2020-07-10 中国邮政储蓄银行股份有限公司 Visual arrangement method and device for construction tasks
CN112947948A (en) * 2020-01-17 2021-06-11 深圳市明源云科技有限公司 Application service deployment method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608710A (en) * 2017-08-31 2018-01-19 华为技术有限公司 Software project structure task collocation method and device based on Jenkins instruments
CN107656734A (en) * 2017-08-21 2018-02-02 北京北信源软件股份有限公司 Update method, system, computer-readable recording medium and the storage control of code release information
CN108108169A (en) * 2017-12-27 2018-06-01 广东小天才科技有限公司 A kind of construction method and system of the multiple-limb based on Jenkins
CN108228256A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Code synchronisation method, apparatus, computer-readable medium and terminal
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application
CN109408106A (en) * 2018-09-27 2019-03-01 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Agile software development continuous integration method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656734A (en) * 2017-08-21 2018-02-02 北京北信源软件股份有限公司 Update method, system, computer-readable recording medium and the storage control of code release information
CN107608710A (en) * 2017-08-31 2018-01-19 华为技术有限公司 Software project structure task collocation method and device based on Jenkins instruments
CN108108169A (en) * 2017-12-27 2018-06-01 广东小天才科技有限公司 A kind of construction method and system of the multiple-limb based on Jenkins
CN108228256A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Code synchronisation method, apparatus, computer-readable medium and terminal
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application
CN109408106A (en) * 2018-09-27 2019-03-01 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Agile software development continuous integration method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112947948A (en) * 2020-01-17 2021-06-11 深圳市明源云科技有限公司 Application service deployment method and device
CN112947948B (en) * 2020-01-17 2024-03-12 深圳市明源云科技有限公司 Deployment method and device of application service
CN111338634A (en) * 2020-02-14 2020-06-26 香港乐蜜有限公司 Parallel construction method, device and equipment
CN111338634B (en) * 2020-02-14 2023-05-23 卓米私人有限公司 Parallel construction method, device and equipment
CN111399814A (en) * 2020-03-09 2020-07-10 中国邮政储蓄银行股份有限公司 Visual arrangement method and device for construction tasks

Similar Documents

Publication Publication Date Title
EP2755149A1 (en) Computer supported software engineering of industrial processes
CN110096304A (en) Task construction method, device, equipment and storage medium based on Jenkins
KR20170015968A (en) High-speed application for installation on mobile devices for permitting remote configuration of such mobile devices
CN109324799A (en) A kind of code compiling method, computer installation and computer readable storage medium
CN107741950A (en) Processing method, device, processor and the service end of data syn-chronization task
US20200387129A1 (en) Method and apparatus for creating and managing smart programmable logic controller (plc) solutions
EP2770428A1 (en) Runtime process diagnostics
CN114237676B (en) FPGA logic updating method, device, equipment and readable storage medium
CN112486491A (en) Page generation method and device, computer equipment and storage medium
CN113296772A (en) Page configuration method and device, computer equipment and readable storage medium
CN112015371A (en) Software development device under non-embedded software platform
CN114968032B (en) Policy arrangement processing method, device, equipment, system and storage medium
CN111984248A (en) Page editing method and device, storage medium and electronic device
CN112052029B (en) Configuration method and system of USB device management software and computer device
CN109725884A (en) Air control ' In System Reconfiguration Method, device, equipment and readable storage medium storing program for executing
CN115202712B (en) Application management method, application subscription method and related equipment
CN113377346B (en) Integrated environment building method and device, electronic equipment and storage medium
CN114327709A (en) Control page generation method and device, intelligent device and storage medium
CN114721681A (en) Configuration file updating method, device, equipment and storage medium
CN113032004B (en) Method, apparatus and program product for managing development jobs in a development environment
CN111443905B (en) Service data processing method, device and system and electronic equipment
CN114077437A (en) Integrated management method, device and system for artificial intelligence application
US20120004895A1 (en) Method and apparatus for testing on-line services
CN110737426A (en) Program block creating method, program block creating device, computer equipment and storage medium
US20190220252A1 (en) System and method for defining and generating requirement data from input

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190806