CN111552629A - Docker-based continuous integration test environment construction method and system - Google Patents
Docker-based continuous integration test environment construction method and system Download PDFInfo
- Publication number
- CN111552629A CN111552629A CN202010203800.9A CN202010203800A CN111552629A CN 111552629 A CN111552629 A CN 111552629A CN 202010203800 A CN202010203800 A CN 202010203800A CN 111552629 A CN111552629 A CN 111552629A
- Authority
- CN
- China
- Prior art keywords
- docker
- test environment
- continuous integration
- file
- integration test
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 54
- 230000010354 integration Effects 0.000 title claims abstract description 20
- 238000010276 construction Methods 0.000 title claims abstract description 8
- 238000000034 method Methods 0.000 claims abstract description 22
- 230000036541 health Effects 0.000 claims description 10
- 238000009434 installation Methods 0.000 claims description 3
- 230000002085 persistent effect Effects 0.000 claims 1
- 238000012544 monitoring process Methods 0.000 abstract description 3
- 238000007726 management method Methods 0.000 abstract description 2
- 238000013508 migration Methods 0.000 abstract description 2
- 230000005012 migration Effects 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010367 cloning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 108090000623 proteins and genes Proteins 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a Docker-based continuous integration test environment construction method and a system, wherein the method comprises the following steps: installing git, docker-compound and vine; placing configuration files under a project code warehouse main directory, wherein the configuration files comprise a clone. Configuring the Dockerfile file, the. line.yml file and the docker-composition.yml file; the drop is started using docker-composition. The invention can realize easier migration and expansion, light-weight plug-in deployment, simpler update management, faster delivery, more effective real-time monitoring and more efficient resource utilization. High quality product is delivered quickly through automated build, test and deployment cycles.
Description
Technical Field
The invention relates to a Docker-based continuous integration test environment building method and system.
Background
Before a docker appears, if an application needs to be deployed, a project environment is initialized, the environment is installed, various dependencies are installed, some possible conflicts are solved, configuration is modified, and then the application is compiled, constructed and started; however, if the server is damaged and needs to be changed, the above processes can be repeated again, and a new deployment problem can occur to wait for solution; however, if the application needs to be promoted, the deployment needs to be manually guided, and the deployment process is repeated for n times. At the moment, a series of development, deployment and application based on docker are produced, and the one-key operation and maintenance of the process can be realized based on docker. However, the automation integrated test environment based on docker is very limited, and on the premise of solving the deployment problem, testers still need to compile images manually in the test link, deploy images, formulate test strategies, check health, check checklist, check test results, maintain test cases or test codes, and the like. Brings long-flow repeated work for testers.
Disclosure of Invention
Aiming at the technical problems, the invention provides a continuous integration test environment building method and system based on Docker.
The technical scheme for solving the technical problems is as follows: a continuous integration test environment building method based on Docker comprises the following steps:
installing git, docker-compound and vine;
placing configuration files under a project code warehouse main directory, wherein the configuration files comprise a clone.
Configuring the Dockerfile file, the. line.yml file and the docker-composition.yml file;
the drop is started using docker-composition.
The invention has the beneficial effects that: the method can realize easier migration and expansion, light-weight plug-in deployment, simpler update management, faster delivery, more effective real-time monitoring and more efficient resource utilization. High quality product is delivered quickly through automated build, test and deployment cycles.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, configuring the clone yml file specifically includes:
the workspace parameter itemization and pipeline parameters are specified in the. line.
Further, the pipeline parameters include self-defined designated step names, mirror names, operation command sets of the steps, trigger conditions, whether to continue execution after failure, and designated dependency relationships.
Further, after starting the clone, the method further comprises the following steps:
constructing and deploying a required test code Docker mirror image;
and carrying out health check on the test code Docker mirror image, and sending a check result to a user.
In order to achieve the above object, the present invention further provides a system for building a continuous integration test environment based on Docker, including:
the installation module is used for installing git, docker-compound and vine;
a placement module for placing configuration files under a project code warehouse master directory, the configuration files including a line.
A configuration module for configuring the Dockerfile file, the. done. yml file and the docker-composition. yml file;
and the starting module is used for starting the line by using docker-composition.
Further, the configuring module configures the gene.
The workspace parameter itemization and pipeline parameters are specified in the. line.
Further, the pipeline parameters include self-defined designated step names, mirror names, operation command sets of the steps, trigger conditions, whether to continue execution after failure, and designated dependency relationships.
Further, still include:
the building and deploying module is used for building and deploying a required test code Docker mirror image after the starting module starts the drone;
and the checking module is used for carrying out health check on the test code Docker mirror image and sending a check result to a user.
Drawings
Fig. 1 is a flowchart of a method for building a continuous integration test environment based on Docker according to an embodiment of the present invention;
FIG. 2 is a flow diagram of code testing based on a built test environment.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of a method for building a continuous integration test environment based on Docker according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s1, mounting git, docker-compound and vine;
s2, placing configuration files under a project code warehouse main directory, wherein the configuration files comprise a clone.
S3, configuring the Dockerfile file, the line.
Yml is used for steps of configuration construction, deployment, health check, point inspection, test result receiving and sending and the like. Yml is simply a process configuration file.
Yml states: such as:
the following parameters were specified as required:
1. details of the workspace parameter are specified.
2. A pipeline parameter is specified. Specifying step names (self-defined), specifying images (mirror names, the essence of each step is to start a container based on this mirror), commands (the set of operation commands for this step), while (the trigger condition for this step), detail/failure (whether a step fails or continues to execute, etc.), depends _ on (specifies dependencies), and so on.
S4, using docker-composition to start the line.
The configuration of the steps is completed, so that the building of an automatic CI (Continuous integration) test environment can be completed, and the automatic test without manual intervention is realized.
Optionally, in this embodiment, the method further includes:
s5, constructing and deploying a required test code Docker mirror image;
and S6, performing health check on the test code Docker image, and sending a check result to a user.
Specifically, as shown in fig. 2, based on the configured configuration file obtained after step S4, the following steps may be performed:
a trigger: specifying a trigger mechanism, wherein a test branch has change or push operation and the like;
the construction steps are as follows: required Docker mirror images, environment variables, compiling instructions and the like;
deployment step: a server is deployed, instructions are deployed, services are restarted in batches, and the like;
a health examination step: a required test code Docker mirror image designates a polling mechanism, executes a health check script, and sends a mail or a short message to a corresponding monitor and the like;
point inspection: a required test code Docker mirror image executes regression checklist, a new function checklist and the like;
receiving and sending test results: and generating and sending regression and new function test results and test reports to a monitoring staff mailbox by using the required test code Docker mirror image.
The embodiment of the invention provides a continuous integration test environment building system based on Docker, which comprises:
the installation module is used for installing git, docker-compound and vine;
a placement module for placing configuration files under a project code warehouse master directory, the configuration files including a line.
A configuration module for configuring the Dockerfile file, the. done. yml file and the docker-composition. yml file;
and the starting module is used for starting the line by using docker-composition.
Optionally, in this embodiment, the system further includes:
the building and deploying module is used for building and deploying a required test code Docker mirror image after the starting module starts the drone;
and the checking module is used for carrying out health check on the test code Docker mirror image and sending a check result to a user.
The continuous integration test environment building method and system based on Docker provided by the embodiment of the invention belong to light-weight environment building, have strong migratable expansibility, and can realize landing of n sets of test environments only by self-defining checklist for different application services. And absolute code isolation is realized, and the condition that each operation is in an absolute isolation environment is guaranteed. And (3) no manual intervention, and one dragon is formed by cloning, constructing, operating and maintaining and testing. Time and labor are saved, and a large amount of repeated regression/system test time and construction and deployment waiting time are saved. And the risk is monitored in real time, and the information is notified in real time, so that all the information is mastered.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the modules and units in the above described system embodiment may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (8)
1. A continuous integration test environment building method based on Docker is characterized by comprising the following steps:
installing git, docker-compound and vine;
placing configuration files under a project code warehouse main directory, wherein the configuration files comprise a clone.
Configuring the Dockerfile file, the. line.yml file and the docker-composition.yml file;
the drop is started using docker-composition.
2. The Docker-based continuous integration test environment construction method according to claim 1, wherein configuring the. clone. yml file specifically includes:
the workspace parameter itemization and pipeline parameters are specified in the. line.
3. The Docker-based persistent integration test environment construction method according to claim 2, wherein the pipeline parameters include custom designated step names, mirror names, operation command sets of each step, trigger conditions, whether to continue execution after failure, and designated dependency relationships.
4. The Docker-based continuous integration test environment building method according to any one of claims 1 to 3, further comprising, after starting the line:
constructing and deploying a required test code Docker mirror image;
and carrying out health check on the test code Docker mirror image, and sending a check result to a user.
5. A continuous integration test environment building system based on Docker is characterized by comprising:
the installation module is used for installing git, docker-compound and vine;
a placement module for placing configuration files under a project code warehouse master directory, the configuration files including a line.
A configuration module for configuring the Dockerfile file, the. done. yml file and the docker-composition. yml file;
and the starting module is used for starting the line by using docker-composition.
6. The Docker-based continuous integration test environment building system according to claim 5, wherein the configuration module configures the. clone.yml file, which specifically includes:
the workspace parameter itemization and pipeline parameters are specified in the. line.
7. The Docker-based continuous integration test environment building system according to claim 6, wherein the pipeline parameters include custom specified step names, mirror names, operation command sets of each step, trigger conditions, whether to continue execution after failure, and specified dependencies.
8. The Docker-based continuous integration test environment building system according to any one of claims 5 to 7, further comprising:
the building and deploying module is used for building and deploying a required test code Docker mirror image after the starting module starts the drone;
and the checking module is used for carrying out health check on the test code Docker mirror image and sending a check result to a user.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010203800.9A CN111552629A (en) | 2020-03-20 | 2020-03-20 | Docker-based continuous integration test environment construction method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010203800.9A CN111552629A (en) | 2020-03-20 | 2020-03-20 | Docker-based continuous integration test environment construction method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111552629A true CN111552629A (en) | 2020-08-18 |
Family
ID=72001875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010203800.9A Pending CN111552629A (en) | 2020-03-20 | 2020-03-20 | Docker-based continuous integration test environment construction method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111552629A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379969A (en) * | 2020-11-13 | 2021-02-19 | 中国人寿保险股份有限公司 | Continuous integrated delivery method based on containerized application and related equipment |
CN113190326A (en) * | 2021-04-20 | 2021-07-30 | 北京异乡旅行网络科技有限公司 | Information processing method and device |
CN113434554A (en) * | 2021-06-30 | 2021-09-24 | 青岛海尔科技有限公司 | Method and device for constructing continuous integration assembly line |
CN113992730A (en) * | 2021-10-27 | 2022-01-28 | 哈尔滨工业大学 | Knowledge-based user behavior simulation method, simulation system, customization system, computer and storage medium |
CN114153520A (en) * | 2021-11-08 | 2022-03-08 | 济南浪潮智投智能科技有限公司 | Batched deployment method and device for Internet of things platform and computer readable medium |
CN114185559A (en) * | 2022-02-16 | 2022-03-15 | 南京安元科技有限公司 | Unified research and development environment visual management method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106815052A (en) * | 2017-01-10 | 2017-06-09 | 南威软件股份有限公司 | A kind of method of the rapid deployment system for being adapted to multi-environment configuration |
CN106873975A (en) * | 2016-12-30 | 2017-06-20 | 武汉默联股份有限公司 | Devops based on Docker persistently pays and automated system and method |
US10515005B1 (en) * | 2018-12-20 | 2019-12-24 | Atlassian Pty Ltd | Systems and methods for testing source code |
-
2020
- 2020-03-20 CN CN202010203800.9A patent/CN111552629A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106873975A (en) * | 2016-12-30 | 2017-06-20 | 武汉默联股份有限公司 | Devops based on Docker persistently pays and automated system and method |
CN106815052A (en) * | 2017-01-10 | 2017-06-09 | 南威软件股份有限公司 | A kind of method of the rapid deployment system for being adapted to multi-environment configuration |
US10515005B1 (en) * | 2018-12-20 | 2019-12-24 | Atlassian Pty Ltd | Systems and methods for testing source code |
Non-Patent Citations (1)
Title |
---|
胡湘菲: "《软件自动化测试环境搭建中的Docker应用》" * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379969A (en) * | 2020-11-13 | 2021-02-19 | 中国人寿保险股份有限公司 | Continuous integrated delivery method based on containerized application and related equipment |
CN112379969B (en) * | 2020-11-13 | 2024-04-16 | 中国人寿保险股份有限公司 | Continuous integrated delivery method based on containerized application and related equipment |
CN113190326A (en) * | 2021-04-20 | 2021-07-30 | 北京异乡旅行网络科技有限公司 | Information processing method and device |
CN113434554A (en) * | 2021-06-30 | 2021-09-24 | 青岛海尔科技有限公司 | Method and device for constructing continuous integration assembly line |
CN113992730A (en) * | 2021-10-27 | 2022-01-28 | 哈尔滨工业大学 | Knowledge-based user behavior simulation method, simulation system, customization system, computer and storage medium |
CN114153520A (en) * | 2021-11-08 | 2022-03-08 | 济南浪潮智投智能科技有限公司 | Batched deployment method and device for Internet of things platform and computer readable medium |
CN114185559A (en) * | 2022-02-16 | 2022-03-15 | 南京安元科技有限公司 | Unified research and development environment visual management method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111552629A (en) | Docker-based continuous integration test environment construction method and system | |
CN109683899B (en) | Software integration method and device | |
CN110532189B (en) | Continuous integration system, method and device | |
CN107463362B (en) | Method and system for continuous deployment based on multiple Jenkins | |
CN111897566A (en) | Software development continuous integration method, device, equipment and medium | |
CN105095059B (en) | A kind of method and apparatus of automatic test | |
CN111258591B (en) | Program deployment task execution method, device, computer equipment and storage medium | |
CN112084008B (en) | Method for rapidly deploying cloud pipe system based on container technology | |
CN108897557B (en) | Updating method and device of microservice architecture | |
JP6922532B2 (en) | Test execution control program, test execution control method, and test execution control device | |
CN110727446A (en) | Automatic deployment method, device, equipment and medium | |
CN112035233A (en) | Big data batch job task scheduling method and device | |
CN114489934A (en) | Continuous delivery method and device based on container | |
CN112596784B (en) | Iterative version deployment method and device | |
CN114911471A (en) | Software engineering construction method, system and storage medium | |
CN110865840A (en) | Application management method, device, server and storage medium | |
CN114968272A (en) | Algorithm operation method, device, equipment and storage medium | |
CN117234760B (en) | DevOps platform creation method, system, storage medium and device | |
CN107678969B (en) | Test version release method and device, version control equipment and test machine | |
CN113485933A (en) | Automatic testing method and distributed system | |
CN117827665A (en) | Project deployment method and device, storage medium and electronic device | |
CN111768129A (en) | Delivery method, device, equipment and storage medium of proprietary cloud product | |
CN111767218A (en) | Automatic testing method, equipment and storage medium for continuous integration | |
CN110764785A (en) | Power industry cloud platform tool chain based on open source assembly and cloud platform operation and maintenance method | |
CN111381932B (en) | Method, device, electronic equipment and storage medium for triggering application program change |
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 |
Application publication date: 20200818 |
|
WD01 | Invention patent application deemed withdrawn after publication |