CN109582319B - Service code deployment method and device - Google Patents

Service code deployment method and device Download PDF

Info

Publication number
CN109582319B
CN109582319B CN201811474207.7A CN201811474207A CN109582319B CN 109582319 B CN109582319 B CN 109582319B CN 201811474207 A CN201811474207 A CN 201811474207A CN 109582319 B CN109582319 B CN 109582319B
Authority
CN
China
Prior art keywords
deployed
code
service code
service
server
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.)
Active
Application number
CN201811474207.7A
Other languages
Chinese (zh)
Other versions
CN109582319A (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201811474207.7A priority Critical patent/CN109582319B/en
Publication of CN109582319A publication Critical patent/CN109582319A/en
Application granted granted Critical
Publication of CN109582319B publication Critical patent/CN109582319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • 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)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a service code deployment method and a device, which are characterized in that under the condition of obtaining a code packet for packaging a service code to be deployed, a server for deploying the service code to be deployed is determined, the code packet is written into the server, and the server is triggered to restart, so that the server is controlled to execute a deployment script deployed in the server restarting process, the server deploys the service code to be deployed packaged in the code packet into the server in the deployment script executing process, the automatic deployment of the service code to be deployed is realized, and compared with the existing manual deployment script executing mode, the online uncontrollable performance is reduced.

Description

Service code deployment method and device
Technical Field
The present invention belongs to the technical field of service code processing, and more particularly, to a service code deployment method and apparatus.
Background
In the day-to-day internet era, products of each company are in an evolution rhythm of rapid prototype gradual iteration, and a service code of the product changes in each iteration process, so that the service code of the product needs to be deployed in each iteration process. The current deployment process of business codes is as follows:
after the service codes are developed, manually upgrading version (version number) of the service codes, creating tags, packaging a Jenkins assembly to obtain a developed code packet of the service codes through the Jenkins assembly, and manually executing online script deployment to deploy the code packet through the online script to realize the deployment of the service codes.
As can be seen from the deployment process of the service code, there are a plurality of manual intervention links in the current deployment process of the service code, such as version for manually upgrading the service code and manually executing online script deployment. But the technical level and professional ability of technicians for online script deployment are different, so that the online script deployment has great uncontrollable property.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method and an apparatus for deploying service codes, which are used to automatically execute an online script to deploy the service codes, so as to reduce the uncontrollable performance of online. The technical scheme is as follows:
the invention provides a service code deployment method, which comprises the following steps:
obtaining a code packet for encapsulating a service code to be deployed;
determining a server needing to deploy the service code to be deployed, wherein the server is provided with a deployment script needed by deploying the service code to be deployed;
writing the code packet into the server and triggering the server to restart;
and controlling the server to execute the deployment script in the restarting process of the server so as to enable the server to deploy the service code to be deployed, which is packaged in the code package, into the server in the process of executing the deployment script.
Preferably, in the process of restarting the server, the controlling the server to execute the deployment script includes:
determining a process for deploying the service code to be deployed packaged in the code package in the server restarting process;
determining a starting parameter required by the process for deploying the service code to be deployed;
determining a storage space required by the service code to be deployed and a port for monitoring the process based on the starting parameter;
controlling the process to write the service code to be deployed into the storage space and controlling the port to monitor the process;
and if the port returns prompt information indicating that the process is successfully written into the service code to be deployed, determining that the deployment of the service code to be deployed is completed.
Preferably, the determining that the server to be deployed with the service code to be deployed needs to include:
and determining a server with the business service based on the business service corresponding to the business code to be deployed, and determining the server with the business service as the server needing to deploy the business code to be deployed.
Preferably, the obtaining the code package encapsulating the service code to be deployed includes: if the current service code is in a service code deployment stage, creating a tag according to the latest code submission in the code library;
acquiring the service code to be deployed from the code base based on the tag;
and encapsulating the service code to be deployed in a code packet.
Preferably, the method further comprises: acquiring the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed;
generating the identity identification information of the service code to be deployed based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed;
and binding the identity identification information of the service code to be deployed with the code packet in which the service code to be deployed is encapsulated.
Preferably, the obtaining the code package encapsulating the service code to be deployed includes: and if the current service code is in the service code rollback stage, obtaining the code packet according to the identity information of the service code to be deployed, which is input by the user.
The invention also provides a service code deployment device, which comprises:
the acquiring unit is used for acquiring a code packet for packaging the service code to be deployed;
a determining unit, configured to determine a server that needs to deploy the service code to be deployed, where a deployment script that is needed to deploy the service code to be deployed is located in the server;
a writing unit configured to write the code packet into the server;
and the control unit is used for triggering the server to restart, and controlling the server to execute the deployment script in the server restarting process so that the server deploys the service code to be deployed, which is packaged in the code packet, into the server in the process of executing the deployment script.
Preferably, the control unit includes:
the triggering subunit is used for triggering the server to restart;
the determining subunit is configured to determine, in a process of restarting the server, a process for deploying the service code to be deployed, which is encapsulated in the code package, determine a start parameter required by the process for deploying the service code to be deployed, and determine, based on the start parameter, a storage space required by the service code to be deployed and a port for monitoring the process;
and the control subunit is used for controlling the process to write the service code to be deployed into the storage space, controlling the port to monitor the process, and determining that the deployment of the service code to be deployed is completed if the port returns prompt information indicating that the process successfully writes the service code to be deployed.
Preferably, the determining unit is configured to determine, based on the service corresponding to the service code to be deployed, a server having the service, and determine the server having the service as a server that needs to deploy the service code to be deployed.
Preferably, the obtaining unit is configured to create a tag according to the latest code submission in a code library if the current service code deployment stage is in the service code deployment stage, obtain the service code to be deployed from the code library based on the tag, encapsulate the service code to be deployed in a code packet, and obtain the code packet according to the identity information of the service code to be deployed, which is input by the user, if the current service code rollback stage is in the service code rollback stage;
wherein the identity information of the service code to be deployed is: and generating based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed.
According to the technical scheme, under the condition that the code packet for packaging the service code to be deployed is obtained, the server which needs to deploy the service code to be deployed is determined, the code packet is written into the server, and the server is triggered to restart, so that the server is controlled to execute the deployment script which is deployed in the server restarting process, the service code to be deployed packaged in the code packet is deployed into the server in the server executing deployment script process by the server, the automatic deployment of the service code to be deployed is realized, and compared with the existing manual deployment script executing mode, the online uncontrollable performance is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a service code deployment method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a service code deployment apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a control unit in a service code deployment apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a service code deployment method provided by an embodiment of the present invention is shown, where the method is used to implement automatic deployment of a service code to be deployed so as to reduce uncontrollable performance of a service code to be deployed, and includes the following steps:
s101: and obtaining a code packet for encapsulating the service code to be deployed. It can be understood that: the code package is obtained by packaging the service codes to be deployed, and can be realized by means of jenkins components, for example, the jenkins components are a continuous integration tool developed based on Java and used for monitoring continuous and repeated work, and different service codes to be deployed are packaged through repeatability of the jenkins components. The service code to be deployed is a program code for implementing a service, for example, the service code to be deployed is a program code for implementing a network security service, or the service code to be deployed is a program code for implementing an audio/video playing service, and the service codes to be deployed for implementing these service may be packaged into a code packet.
In this embodiment, the obtaining manner of the code package may be different according to different current stages, for example, the current stage includes a service code deployment stage and a service code rollback stage, where the service code deployment stage is a deployment stage of a service code to be deployed, and the service code rollback stage is a service code to be deployed that is rolled back from a current service code to be deployed to a service code to be deployed that needs to be deployed last time, where the current service code to be deployed is a service code written after the service code to be deployed that needs to be deployed last time, for a plurality of service codes to be deployed corresponding to the same service.
In practical application, a service code deployment stage and a service code rollback stage can be displayed to a user, one stage is selected from the two stages by the user as a current stage of a code package, for example, the service code deployment stage and the service code rollback stage are displayed to the user in an interface mode, for example, the display can be performed in a button control mode, and after any button control is detected to be triggered, whether the button control corresponding to the service code deployment stage or the button control corresponding to the service code rollback stage is triggered is determined based on a trigger position, so that the current stage of the code package is obtained. The following describes the code packet obtaining procedure in these two phases:
in the service code deployment stage, a tag is created according to the latest code submission in the code base, the service code to be deployed is obtained from the code base based on the tag, and the service code to be deployed is packaged in a code packet. That is to say, the code library is a database for storing service codes to be deployed, in a service code deployment stage, a tag needs to be created according to the latest code submission in the code library, so that the code submitted last time can be acquired based on the tag as a service code to be deployed, and then a code packet is obtained by encapsulation.
And in the service code rollback stage, obtaining a code packet according to the identity identification information of the service code to be deployed, which is input by a user. The identity information of the service code to be deployed is the only identity of the service code to be deployed like an identity card, so as to distinguish different service codes to be deployed, and the service code to be deployed is encapsulated in one code packet, so that the identity information of the service code to be deployed can also be regarded as the identity information of the code packet, and further the code packet corresponding to the identity information of the service code to be deployed can be acquired, and the mode for the user to input the identity information of the service code to be deployed is at least one of voice input, touch input and key input.
In this embodiment, the generating process of the identity information of the service code to be deployed includes: the method comprises the steps of obtaining the version number of a service code to be deployed and the identity identification information of a service module corresponding to the service code to be deployed, and generating the identity identification information of the service code to be deployed based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed.
For example, the version number of the service code to be deployed and the identity information of the service module corresponding to the service code to be deployed are combined into the identity information of the service code to be deployed, for example, the combination method includes, but is not limited to: and one of the version number of the service code to be deployed and the identity information of the service module corresponding to the service code to be deployed is positioned before the other one to form the identity information of the service code to be deployed, or the version number of the service code to be deployed and the data in the identity information of the service module corresponding to the service code to be deployed are crossed with each other to form the identity information of the service code to be deployed.
The identity information of the service module corresponding to the service code to be deployed is also used for uniquely distinguishing the service module corresponding to the service code to be deployed, and the form of the identity information of the service module is not described in this embodiment, and in addition, the identity information of the service module corresponding to the service code to be deployed is required because:
a business service is provided with a plurality of business modules correspondingly, each business module shares a version number, and business codes to be deployed corresponding to different business modules need to be deployed independently, so in order to distinguish the business codes to be deployed of the business modules which are deployed independently, identity identification information of the business modules needs to be added into the identity identification information of the business codes to be deployed. In addition, when generating the identification information of the service code to be deployed, the first N bits of the version number may also be taken, where N is a natural number and a value of N may be determined according to an actual application, for example, the first 8 bits are taken, which is not limited in this embodiment.
After the identity information of the service code to be deployed is generated, the identity information of the service code to be deployed and the code packet encapsulating the service code to be deployed can be bound, that is, the identity information of the service code to be deployed and the code packet encapsulating the service code to be deployed correspond to each other, so that in the service code rollback stage, the code packet can be acquired according to the identity information of the service code to be deployed input by a user.
S102: and determining a server needing to deploy the service codes to be deployed, wherein the server is provided with a deployment script needed by deploying the service codes to be deployed, and the deployment script is used for deploying the service codes to be deployed. In this embodiment, the manner of determining the server that needs to deploy the service code to be deployed includes, but is not limited to, the following manners:
and determining a server with the business service based on the business service corresponding to the business code to be deployed, and determining the server with the business service as the server needing to deploy the business code to be deployed. That is to say, a server with the same service as the service corresponding to the service code to be deployed is taken as the server needing to deploy the service code to be deployed, wherein the service of the server is obtained in the following manner: the service deployment method includes the steps of recording business services of each server in advance, for example, recording the business services of each server in a cloud platform, or recording the business services of each server in a server registration process, or acquiring the business services of each server in a script mode, wherein the script is different from a deployment script used for deploying business codes to be deployed.
S103: and writing the code packet into the server and triggering the server to restart. The points to be explained here are: the number of servers needing to deploy the service codes to be deployed is multiple, information of the servers can be recorded in a server data table after the servers are determined, and then the code packets are written into the servers in sequence. When the servers are restarted, the servers may be restarted simultaneously, or restarted in batches, for example, the servers with small traffic flow and large residual load are restarted in batches according to the traffic flow and the residual load of each server in the servers, for example, the servers with small traffic flow and large residual load are restarted preferentially, and the specific batch embodiment is not limited.
S104: in the restarting process of the server, the control server executes the deployment script, so that the server deploys the service code to be deployed, which is packaged in the code packet, into the server in the process of executing the deployment script, and thus, the service code to be deployed can be deployed onto the server in the restarting process of the server, and the automatic deployment and upgrade of the service code to be deployed are realized. The process of controlling the server to execute the deployment script in the process of restarting the server is as follows:
determining a process for deploying the service code to be deployed packaged in the code package in the restarting process of the server; determining starting parameters required by a process for deploying service codes to be deployed; determining a storage space required by the service code to be deployed and a port for monitoring a process based on the starting parameter; and controlling the process to write the service code to be deployed into the storage space, controlling the port to monitor the process, and determining to finish the deployment of the service code to be deployed if the port returns prompt information indicating that the process successfully writes the service code to be deployed.
The starting parameter records a memory and a port number required by deploying the service code to be deployed, so that a storage space occupied by the service code to be deployed and a port corresponding to the port number can be divided from the server through the starting parameter, a process of writing the service code to be deployed in the storage space by a process is monitored through the port, if prompt information monitored by the port indicates that the service code to be deployed is successfully written, the service code to be deployed is successfully written into the storage space, and the process can be ended at this moment.
According to the technical scheme, under the condition that the code packet for packaging the service code to be deployed is obtained, the server which needs to deploy the service code to be deployed is determined, the code packet is written into the server, and the server is triggered to restart, so that the server is controlled to execute the deployment script which is deployed in the server restarting process, the service code to be deployed packaged in the code packet is deployed into the server in the server executing deployment script process by the server, the automatic deployment of the service code to be deployed is realized, and compared with the existing manual deployment script executing mode, the online uncontrollable performance is reduced.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a service code deployment apparatus, where the structure of the apparatus is shown in fig. 2, and the apparatus may include: an obtaining unit 11, a determining unit 12, a writing unit 13 and a control unit 14.
An obtaining unit 11, configured to obtain a code package encapsulating a service code to be deployed. In this embodiment, the obtaining manner of the code package may be different according to the current stage, for example, the current stage has a service code deployment stage and a service code rollback stage, and in the service code deployment stage, the process of obtaining the code package by the obtaining unit 11 is as follows: and creating a tag according to the latest code submission in the code base, acquiring the service code to be deployed from the code base based on the tag, and packaging the service code to be deployed in the code packet. That is to say, the code library is a database for storing service codes to be deployed, in a service code deployment stage, a tag needs to be created according to the latest code submission in the code library, so that the code submitted last time can be acquired based on the tag as a service code to be deployed, and then a code packet is obtained by encapsulation.
And in the service code rollback stage, obtaining a code packet according to the identity identification information of the service code to be deployed, which is input by a user. The identity information of the service code to be deployed is the only identity of the service code to be deployed like an identity card, so as to distinguish different service codes to be deployed, and the service code to be deployed is encapsulated in one code packet, so that the identity information of the service code to be deployed can also be regarded as the identity information of the code packet, and further the code packet corresponding to the identity information of the service code to be deployed can be acquired, and the mode for the user to input the identity information of the service code to be deployed is at least one of voice input, touch input and key input.
In this embodiment, the identity information of the service code to be deployed: and generating based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed. For example, the version number of the service code to be deployed and the identity information of the service module corresponding to the service code to be deployed are combined into the identity information of the service code to be deployed, for example, the combination method includes, but is not limited to: specifically, please refer to the relevant description in the method embodiment, which will not be described further herein, that is, the version number of the service code to be deployed and the identification information of the service module corresponding to the service code to be deployed are located before each other to form the identification information of the service code to be deployed, or the version number of the service code to be deployed and the data in the identification information of the service module corresponding to the service code to be deployed are crossed with each other to form the identification information of the service code to be deployed.
The determining unit 12 is configured to determine a server that needs to deploy the service code to be deployed, where the server has a deployment script that is needed to deploy the service code to be deployed, and the deployment script is used to deploy the service code to be deployed. In this embodiment, the manner of determining the server that needs to deploy the service code to be deployed includes, but is not limited to, the following manners:
and determining a server with the business service based on the business service corresponding to the business code to be deployed, and determining the server with the business service as the server needing to deploy the business code to be deployed. That is to say, a server having the same service as the service corresponding to the service code to be deployed is taken as the server that needs to deploy the service code to be deployed, where the manner of acquiring the service of the server may refer to the relevant description in the embodiment of the method, and no further description is provided in this embodiment.
And a writing unit 13 for writing the code packet into the server.
The control unit 14 is configured to trigger a server to restart, and control the server to execute the deployment script in the server restarting process, so that the server deploys the service code to be deployed, which is encapsulated in the code packet, to the server in the process of executing the deployment script, so that the service code to be deployed can be deployed to the server in the server restarting process, and automatic deployment and upgrade of the service code to be deployed are achieved.
In this embodiment, the structure of the control unit 14 is shown in fig. 3, and may include: a triggering subunit 141, a determining subunit 142, and a controlling subunit 143.
And a triggering subunit 141, configured to trigger server restart. The points to be explained here are: the number of servers that need to deploy the service code to be deployed may be multiple, and when the servers are restarted, the servers may be restarted at the same time, or restarted in batches, for example, restarted in batches according to the service traffic and the remaining load of each server in the servers, for example, a server with a small service traffic and a large remaining load is restarted preferentially, and the specific batch embodiment is not limited.
The determining subunit 142 is configured to determine, in the process of restarting the server, a process for deploying the service code to be deployed that is packaged in the code package, determine a start parameter required by the process for deploying the service code to be deployed, and determine, based on the start parameter, a storage space required by the service code to be deployed and a port for monitoring the process.
The starting parameter records the memory and the port number required by the service code to be deployed, so that the memory space occupied by the service code to be deployed and the port corresponding to the port number can be divided from the server through the starting parameter.
And the control subunit 143 is configured to control the process to write the service code to be deployed in the storage space, control the port to monitor the process, determine that the deployment of the service code to be deployed is completed if the port returns the prompt information indicating that the process successfully writes the service code to be deployed, and at this time, end the process.
According to the technical scheme, under the condition that the code packet for packaging the service code to be deployed is obtained, the server which needs to deploy the service code to be deployed is determined, the code packet is written into the server, and the server is triggered to restart, so that the server is controlled to execute the deployment script which is deployed in the server restarting process, the service code to be deployed packaged in the code packet is deployed into the server in the server executing deployment script process by the server, the automatic deployment of the service code to be deployed is realized, and compared with the existing manual deployment script executing mode, the online uncontrollable performance is reduced.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. A method for deploying service codes, the method comprising:
obtaining a code packet for encapsulating a service code to be deployed;
determining a server needing to deploy the service code to be deployed, wherein the server is provided with a deployment script needed by deploying the service code to be deployed;
writing the code packet into the server and triggering the server to restart;
controlling the server to execute the deployment script in the process of restarting the server so as to enable the server to deploy the service code to be deployed, which is packaged in the code package, into the server in the process of executing the deployment script;
wherein, in the process of restarting the server, the controlling the server to execute the deployment script comprises:
determining a process for deploying the service code to be deployed packaged in the code package in the server restarting process;
determining a starting parameter required by the process for deploying the service code to be deployed;
determining a storage space required by the service code to be deployed and a port for monitoring the process based on the starting parameter;
controlling the process to write the service code to be deployed into the storage space and controlling the port to monitor the process;
and if the port returns prompt information indicating that the process is successfully written into the service code to be deployed, determining that the deployment of the service code to be deployed is completed.
2. The method of claim 1, wherein the determining that the server to deploy the service code to be deployed needs to be deployed comprises:
and determining a server with the business service based on the business service corresponding to the business code to be deployed, and determining the server with the business service as the server needing to deploy the business code to be deployed.
3. The method of claim 1, wherein the obtaining a code package encapsulating the service code to be deployed comprises: if the current service code is in a service code deployment stage, creating a tag according to the latest code submission in the code library;
acquiring the service code to be deployed from the code base based on the tag;
and encapsulating the service code to be deployed in a code packet.
4. The method of claim 3, further comprising: acquiring the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed;
generating the identity identification information of the service code to be deployed based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed;
and binding the identity identification information of the service code to be deployed with the code packet in which the service code to be deployed is encapsulated.
5. The method of claim 1, wherein the obtaining a code package encapsulating the service code to be deployed comprises: and if the current service code is in the service code rollback stage, obtaining the code packet according to the identity information of the service code to be deployed, which is input by the user.
6. A service code deployment apparatus, the apparatus comprising:
the acquiring unit is used for acquiring a code packet for packaging the service code to be deployed;
a determining unit, configured to determine a server that needs to deploy the service code to be deployed, where a deployment script that is needed to deploy the service code to be deployed is located in the server;
the writing unit is used for writing the code packet into the server and triggering the server to restart;
the control unit is used for controlling the server to execute the deployment script in the process of restarting the server so as to enable the server to deploy the service code to be deployed, which is packaged in the code package, into the server in the process of executing the deployment script;
wherein the control unit includes:
the triggering subunit is used for triggering the server to restart;
the determining subunit is configured to determine, in a process of restarting the server, a process for deploying the service code to be deployed, which is encapsulated in the code package, determine a start parameter required by the process for deploying the service code to be deployed, and determine, based on the start parameter, a storage space required by the service code to be deployed and a port for monitoring the process;
and the control subunit is used for controlling the process to write the service code to be deployed into the storage space, controlling the port to monitor the process, and determining that the deployment of the service code to be deployed is completed if the port returns prompt information indicating that the process successfully writes the service code to be deployed.
7. The apparatus according to claim 6, wherein the determining unit is configured to determine, based on the service corresponding to the service code to be deployed, a server having the service, and determine the server having the service as the server that needs to deploy the service code to be deployed.
8. The apparatus according to claim 6, wherein the obtaining unit is configured to create a tag according to a latest code submission in a code library if the apparatus is currently in a service code deployment phase, obtain the service code to be deployed from the code library based on the tag, encapsulate the service code to be deployed in a code package, and obtain the code package according to identity information of the service code to be deployed, which is input by a user, if the apparatus is currently in a service code rollback phase;
the identity identification information of the service code to be deployed; and generating based on the version number of the service code to be deployed and the identity identification information of the service module corresponding to the service code to be deployed.
CN201811474207.7A 2018-12-04 2018-12-04 Service code deployment method and device Active CN109582319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811474207.7A CN109582319B (en) 2018-12-04 2018-12-04 Service code deployment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811474207.7A CN109582319B (en) 2018-12-04 2018-12-04 Service code deployment method and device

Publications (2)

Publication Number Publication Date
CN109582319A CN109582319A (en) 2019-04-05
CN109582319B true CN109582319B (en) 2022-02-08

Family

ID=65927253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811474207.7A Active CN109582319B (en) 2018-12-04 2018-12-04 Service code deployment method and device

Country Status (1)

Country Link
CN (1) CN109582319B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110308911A (en) * 2019-07-09 2019-10-08 西安点告网络科技有限公司 Software program delivery method, device, terminal and storage medium
CN111581014B (en) * 2020-03-30 2024-03-22 中国建设银行股份有限公司 Method and device for restarting automatic control host and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743680A (en) * 2014-12-11 2016-07-06 深圳云之家网络有限公司 Cluster disposition method and disposition device
CN106104467A (en) * 2014-06-30 2016-11-09 北京新媒传信科技有限公司 A kind of Automation arranging method and terminal
CN106385333A (en) * 2016-09-19 2017-02-08 努比亚技术有限公司 Automatic deploying method and system for application program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080250385A1 (en) * 2007-04-09 2008-10-09 Sanchez Elton R Automating the deployment of applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106104467A (en) * 2014-06-30 2016-11-09 北京新媒传信科技有限公司 A kind of Automation arranging method and terminal
CN105743680A (en) * 2014-12-11 2016-07-06 深圳云之家网络有限公司 Cluster disposition method and disposition device
CN106385333A (en) * 2016-09-19 2017-02-08 努比亚技术有限公司 Automatic deploying method and system for application program

Also Published As

Publication number Publication date
CN109582319A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN111309336B (en) Deployment method and device of distributed application
CN106610839B (en) Method for issuing upgrade package, lightweight upgrade method, device and system
KR101674975B1 (en) System upgrade method, apparatus, device, program, and recording medium
CN109582319B (en) Service code deployment method and device
CN108804399B (en) Form verification method and device
CN110750415B (en) Interface service configuration method, device, medium and computer equipment
CN112579099A (en) Code deployment method and device, storage medium and electronic equipment
CN111651140B (en) Service method and device based on workflow
CN110908670A (en) Method and device for automatically publishing service
CN111338656A (en) Method and device for installing software package to target host and computer equipment
CN113077260A (en) Data access method and device based on block chain and electronic equipment
CN106874029B (en) Mirror image file loading method and device
CN110471828B (en) Operating system testing method, device and equipment thereof
CN115857961A (en) Multi-platform project unified deployment method and device
CN112162766B (en) Linux script application deployment method, computer equipment and storage medium
CN114764335A (en) Method, device, terminal and storage medium for generating mirror image
CN113886016A (en) Method and device for generating mirror image file
CN109117122B (en) List view creating method and device
CN106921521B (en) Equipment information loading method and network equipment
CN109684191B (en) Application package construction method, device and equipment and readable storage medium
CN112162732A (en) Module construction method, module construction device, storage medium and electronic device
CN110727416A (en) Development framework generation method and related device
CN111913720A (en) Program deployment method and device
CN111198725A (en) Application starting processing method, computing equipment and computer storage medium
CN112966204B (en) Website record information submitting method and device

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
GR01 Patent grant
GR01 Patent grant