Summary of the invention
The purpose of the present invention is in view of the drawbacks of the prior art, providing a kind of code dispositions method, realizing can basis
Customer demand is issued in advance automatically, test, then disposes the function of being issued automatically with the code of re-test with deployment, is weakened simultaneously
The deployment of the most time-consuming, the most cumbersome code and the update of work, especially web page code is updated in daily maintenance work,
The time cost of code development personnel is greatly saved.Also, the embodiment of the present invention also improves code publication, test and deployment
Efficiency, reduce operation threshold, simplify operating procedure, so that the publication of code and deployment module, automation, improve
Working efficiency.
To achieve the goals above, the embodiment of the invention provides a kind of code dispositions methods, comprising:
The code that pre- release module in code deployment platform receives user's input disposes request, and obtains and the code
Corresponding code to be disposed is requested in deployment;The deployable state information of the code to be disposed is first state information;
The pre- release module tests the code to be disposed in exploitation environment, generates the according to test result
One test result code;
Determine whether the first test result code is the first result code;
When the first test result code is first result code, by the deployable state information of the code to be disposed
It is updated to the second status information, and the code to be disposed is sent to the deployment module in the code deployment platform;
The deployment module in production environment disposes the code to be disposed, and by the code to be disposed
Deployable state information update is third state information;
Also, the deployment module tests the code to be disposed in the production environment, is tied according to test
Fruit generates the second test result code;
Determine whether the second test result code is not first result code;
When the second test result code is not first result code, is generated and tested according to second test result
The prompt information of failure, and export;The prompt information of the test crash includes test report;
Also, the deployment module cancels the deployment of the code to be disposed in the production environment, and will it is described to
The deployable state information update for disposing code is the first state information.
Preferably, after the acquisition is corresponding with code deployment request wait dispose code, the method is also
Include:
The pre- release module stores the code to be disposed in the code database into the code deployment platform.
Preferably, the pre- release module tests the code to be disposed in exploitation environment, is tied according to test
Fruit generates the first test result code specifically:
Edit script corresponding with the code to be disposed is determined in the exploitation environment;
The code to be disposed is compiled according to the compilation script, and is transported according to the data in the exploitation environment
The row code to be disposed;
The first test result code is generated according to compiling result and operation result.
Preferably when the first test result code is not first result code, the method also includes:
The pre- release module generates the prompt information of the test crash according to first test result.
Preferably, the deployment module tests the code to be disposed in the production environment, according to test
As a result the second test result code is generated specifically:
Edit script corresponding with the code to be disposed is determined in the production environment;
The code to be disposed is compiled according to the compilation script, and is transported according to the data in the production environment
The row code to be disposed;
The second test result code is generated according to compiling result and operation result.
It is further preferred that test result code includes according to the compiling result code of the compiling result generation and according to described
The operation result code that operation result generates.
Preferably, when the second test result code is first result code, the method also includes:
The deployment module, which generates, disposes successful prompt information, and exports.
Preferably, when the second test result code is not first result code, the method also includes:
The prompt information of the test crash is sent to the pre- release module, to the pre- release module according to institute
It is the first state information that the prompt information of test crash, which is stated, by the deployable state information update of the code to be disposed, and defeated
The prompt information of the test crash out.
Preferably, in the pre- release module according to the prompt information of the test crash by the portion of the code to be disposed
Administration's state information updating is the first state information, and after exporting the prompt information of the test crash, the method is also
Include:
The pre- release module receives the updated code to be disposed that user inputs according to the test report, and in institute
It states and the updated code to be disposed is tested in exploitation environment.
Preferably, the code development environment is first environment set, and the code production environment is second environment set.
A kind of code dispositions method provided in an embodiment of the present invention, realizing can be sent out in advance automatically according to customer demand
Cloth, test, then the function of being issued automatically with the code of re-test with deployment is disposed, while reducing in daily maintenance work most
For the update of time-consuming, the most cumbersome code deployment and update work, especially web page code, code development people is greatly saved
The time cost of member.Also, the embodiment of the present invention also improves the efficiency of code publication, test and deployment, reduces operation door
Sill simplify operating procedure, so that the publication of code and deployment module, automation, improve working efficiency.
Specific embodiment
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
A kind of code dispositions method provided in an embodiment of the present invention, is implemented in code deployment platform, to better understand
Technical solution provided in an embodiment of the present invention is first below illustrated code deployment platform.
Code deployment platform can be understood as being intended for code development personnel, for what is disposed to institute's exploitation code
Platform.Code deployment platform can be achieved at the same time in code development environment and in code building environment.Code development environment can be with
It is interpreted as the first environment of software, hardware requirement and operating system platform that code development personnel use in exploitation code
Set, correlated process, activity and task to support code exploitation.Code production environment can be understood as code development personnel
After exploitation code, the commencement of commercial operation code and software, hardware requirement and the operating system that use are put down when providing externally service
The second environment set of platform, to the correlated process of support code commencement of commercial operation, activity and task.
A kind of code dispositions method provided in an embodiment of the present invention, in code deployment platform automatic deployment developed
Code, method flow diagram is as shown in Figure 1, include the following steps:
Step 100, the code that pre- release module receives user's input disposes request;
Specifically, including pre- release module and deployment module in code deployment platform.Wherein pre- release module was used in generation
Code is developed and tested in code exploitation environment, deployment module is for code to be deployed in code production environment and in generation
Code is tested and run in code production environment.
The code that pre- release module in code deployment platform receives user's input disposes request, and obtains and dispose with code
After requesting corresponding code to be disposed, this process to can be understood as user's release code deployment requirements, pre- release module
The process with demand correlation engineering code can be obtained automatically according to demand.Also, pre- release module get code deployment ask
After asking, code to be disposed can also be stored in the code database into code deployment platform.At this point, it is right to be somebody's turn to do code institute to be disposed
The deployable state information answered is the first state information of " to be tested ".
Step 110, pre- release module is treated deployment code in exploitation environment and is tested;
It is tested specifically, pre- release module treats deployment code in exploitation environment.Carrying out test to code includes
Two parts, one is tested the logic of language of code, determines whether code can compile success.The other is to generation
Code carries out functional test, determines whether code can satisfy the functional requirement realized needed for user.
Further specific, pre- release module determines editor's foot corresponding with code to be disposed in exploitation environment first
This, then treats deployment code according to compilation script and is compiled, according to the data run in exploitation environment if compiling successfully
Code to be disposed finally is generated according to compiling result and operation result and is tied for the first test after exploitation environment is tested
Fruit code.First test result code includes the compiling result code generated according to compiling result and the operation knot generated according to operation result
Fruit code.If compiling is unsuccessful, operation result code is sky.
Step 120, determine whether the first test result code is the first result code;
Treat whether first test result code of the deployment code after exploitation environment is tested is representative specifically, determining
The first result code that test passes through, that is, determine whether code to be disposed passes through test in exploitation environment.When the first survey
When compiling result code and operation result code in test result code are the first result code, illustrate code to be disposed in exploitation environment
Pass through test, then executes following step 130.When any in the compiling result code and operation result code in the first test result code
When one result code is not the first result code, illustrate that code to be disposed not over test, then executes following in exploitation environment
Step 180.
Step 130, code to be disposed is sent to deployment module;
Specifically, when in the first test result code compiling result code and operation result code be the first result code when,
Exactly when having passed through test in developing environment wait dispose code, so that it may which preparation treats deployment code and carries out online deployment
?.The deployable state information update of code to be disposed is second status information of " wait dispose " by pre- release module first, and will
Code to be disposed is sent to deployment module.
Step 140, deployment module is treated deployment code in production environment and is tested;
Specifically, deployment module is receiving after disposing code, code to be disposed is disposed in production environment, and will
The deployable state information update of code to be disposed is the third state information of " deployment ".Also, deployment module can also produce
Deployment code is treated in environment to be tested again.It equally includes test being carried out to the logic of language of code and to generation that it, which is tested,
Code carries out the two parts of functional test.
Further specifically, deployment module determines editor's foot corresponding with code to be disposed in production environment first
This, treats deployment code according to compilation script and is compiled, wait for portion according to the data run in production environment if compiling successfully
Code is affixed one's name to, is finally generated according to compiling result and operation result for the second test result after production environment is tested
Code.Second test result code equally includes the compiling result code generated according to compiling result and the operation generated according to operation result
Result code.If compiling is unsuccessful, operation result code is sky.
It should be noted that production environment and the exploitation environment code running environment that be two different, to the volume of code
The data for translating script and operation code are different, and the data especially in production environment are for the data in exploitation environment
It is usually less also more single.Even if therefore code have passed through the test in exploitation environment, also not necessarily ensuring that can produced
Error-free operation in environment.But in general, if code can not exploitation environment in by test, also necessarily can not be in production environment
It operates normally.
Step 150, determine whether the second test result code is the first result code;
Treat whether second test result code of the deployment code after production environment is tested also is generation specifically, determining
The first result code that table test passes through, that is, determine whether code to be disposed passes through test in exploitation environment.When second
When compiling result code and operation result code in test result code are also the first result code, illustrate code to be disposed in production ring
Test is had also passed through in border, then executes following step 160.When the compiling result code and operation result code in the second test result code
In any one result code when not being the first result code, illustrate that code to be disposed not over test, is then held in production environment
Row step 170.
Step 160, deployment module, which generates, disposes successful prompt information, and exports;
Specifically, when in the second test result code compiling result code and operation result code be also the first result code when,
Namely when code to be disposed not only has passed through test in exploitation environment, when also having also passed through test in production environment, portion
It affixes one's name to module and generates the successful prompt information of deployment, and export, to prompt user's code to be disposed with successful deployment.At this point, to
Deployment code completes deployment process.
Step 170, deployment module cancels the deployment of code to be disposed in production environment;
Specifically, any one result code is not in compiling result code and operation result code in the second test result code
When the first result code, that is, when wait dispose code in production environment not over test when, deployment module is cancelled wait dispose
The deployment of code in production environment, while being the first of " to be tested " by the deployable state information update of code to be disposed
Status information.
Step 180, the prompt information of test crash is generated according to test result, and is exported;
Specifically, any one result code is not in compiling result code and operation result code in the first test result code
When the first result code, that is, when wait dispose code develop environment in not over test when, pre- release module is according to first
Test result generates the prompt information of test crash, and exports.At this point, the code to be disposed of test crash will not obtain portion
Administration, and user can also code be disposed can dispose it is online before, learn that there are problems for code to be disposed.
Alternatively, any one result code is not the in compiling result code and operation result code in the second test result code
When one result code, that is, when wait dispose code in production environment not over test when, deployment module according to second test
As a result the prompt information of test crash is generated, and is exported.In the prompt information of deployment module output test crash, can will also survey
The prompt information of examination failure is sent to pre- release module, will be wait dispose according to the prompt information of test crash to pre- release module
The deployable state information update of code is the first state information of " to be tested ", and exports the prompt information of test crash.Also
It is to say, no matter code to be disposed is in exploitation environment not over test, still in production environment not over test
, pre- release module can all receive the prompt information of test crash.
Whether pre- release module generates the prompt information or deployment module root of test crash according to the first test result
The prompt information of test crash is generated according to the second test result, all includes test report.Test report includes the original of test crash
Cause and test environment to user by checking the reason of test report determines code tester failure, and determine that code is that do not have
Pass through test again without in production environment by testing in exploitation environment.
Step 190, pre- release module receives the updated code to be disposed of user's input;
Specifically, pre- release module receives the updated code to be disposed that user inputs according to test report, then return
Receipt row step 110, that is, continue to test updated code to be disposed in exploitation environment.This process can be with
It is interpreted as pre- release module to modify after disposing code user, test, deployment is re-started to modified code to be disposed
Process, until determining that treating second test result code of the deployment code after production environment is tested is in step 150
Represent the first result code that test passes through.
A kind of code dispositions method provided in an embodiment of the present invention, realizing can be sent out in advance automatically according to customer demand
Cloth, test, then the function of being issued automatically with the code of re-test with deployment is disposed, while reducing in daily maintenance work most
For the update of time-consuming, the most cumbersome code deployment and update work, especially web page code, code development people is greatly saved
The time cost of member.Also, the embodiment of the present invention also improves the efficiency of code publication, test and deployment, reduces operation door
Sill simplify operating procedure, so that the publication of code and deployment module, automation, improve working efficiency.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can be executed with hardware, processor
The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, the control of CD-ROM dynamical system
In any other form of storage medium well known in method or technical field.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects
It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention
Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.