CN116719546A - Remote server code updating system and method - Google Patents

Remote server code updating system and method Download PDF

Info

Publication number
CN116719546A
CN116719546A CN202310692174.8A CN202310692174A CN116719546A CN 116719546 A CN116719546 A CN 116719546A CN 202310692174 A CN202310692174 A CN 202310692174A CN 116719546 A CN116719546 A CN 116719546A
Authority
CN
China
Prior art keywords
server
code
maintenance
project
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310692174.8A
Other languages
Chinese (zh)
Inventor
李凌涛
王珍泰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Carbit Information Co ltd
Original Assignee
Wuhan Carbit Information 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 Wuhan Carbit Information Co ltd filed Critical Wuhan Carbit Information Co ltd
Priority to CN202310692174.8A priority Critical patent/CN116719546A/en
Publication of CN116719546A publication Critical patent/CN116719546A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a remote server code updating system and a method, wherein the system comprises the following steps: the operation and maintenance server is used for executing an operation and maintenance script after an operation and maintenance person logs in the server and modifies the execution script parameters according to the name of the pre-deployed project, the ID of the submitted project and the main branch of the Gitlab, automatically logging in the springboard machine server and displaying the execution process and the result on a terminal interface; the springboard machine server is used for entering the release project catalog, switching to a code production branch, executing a Git pull instruction to pull the latest code to the self, and synchronizing the code to the project catalog of the production server through an rsync command; and the production server is used for receiving the rsync updating project code file sent by the springboard machine server, updating the project file catalog content and initializing after the updating is completed. According to the scheme, automatic operation and maintenance updating of the remote server codes can be realized, occupation of working time of operation and maintenance personnel is reduced, operation and maintenance efficiency is improved, and errors caused by human factors are avoided.

Description

Remote server code updating system and method
Technical Field
The invention belongs to the field of automatic operation and maintenance, and particularly relates to a remote server code updating system and method.
Background
In the daily development process, a gitlab or svn code management tool is usually used, and a self-built gitlab code warehouse management system is exemplified, after the local development and testing are completed, the codes need to be merged into a master branch and pushed to a remote gitlab warehouse. At this time, a special server is required to be deployed by land operation and maintenance, a project directory is entered, a master branch is switched, a gate pull up latest codes is executed, then an rsync command is manually operated to upload the project codes to a production server, then a service restarting function of the production server is executed, and production service is started.
In the process, operation and maintenance personnel are required to participate in the whole process on line, so that a large amount of working time is consumed, human errors are easily caused, and the program update version is possibly disordered.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a remote server code updating system and method, which are used for solving the problems that the existing remote server code updating operation personnel consume a long time and are easy to cause updating errors.
In a first aspect of an embodiment of the present invention, there is provided a remote server code update system, including:
the operation and maintenance server is used for executing an operation and maintenance script after an operation and maintenance person logs in the server and modifies the execution script parameters according to the name of the pre-deployed project, the ID of the submitted project and the main branch of the Gitlab, automatically logging in the springboard machine server and displaying the execution process and the result on a terminal interface;
the springboard machine server is used for entering the release project catalog, switching to a code production branch, executing a Git pull instruction to pull the latest code to the self, and synchronizing the code to the project catalog of the production server through an rsync command;
and the production server is used for receiving the rsync updating project code file sent by the springboard machine server, updating the project file catalog content, and executing a remote initialization instruction to initialize after the updating is finished.
In a second aspect of the embodiment of the present invention, there is provided a remote server code updating method, including:
after an operation and maintenance person logs in an operation and maintenance server and modifies execution script parameters according to a pre-deployment project name, a submitted project ID and a Gitlab main branch, executing an operation and maintenance script, automatically logging in a springboard machine server, and displaying an execution process and a result on a terminal interface;
entering an issued project directory, switching to a code production branch, executing a Git pull instruction to pull the latest code to a local machine, and synchronizing the code to the project directory of a production server through an rsync command;
and receiving rsync updating project code files sent by the trigger server, updating the project file catalog content, and executing a remote initialization instruction for initialization after the updating is completed.
In a third aspect of the embodiments of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect of the embodiments of the present invention when the computer program is executed by the processor.
In a fourth aspect of the embodiments of the present invention, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method provided by the first aspect of the embodiments of the present invention.
In the embodiment of the invention, the code synchronous update is completed based on the trigger server through the predefined operation and maintenance script, so that the automatic update of the remote server code can be realized, the operation and maintenance personnel are not required to participate in the whole process on line, the excessive occupation of the time of the operation and maintenance personnel is avoided, and the operation and maintenance efficiency is improved. Meanwhile, by executing the predefined operation and maintenance script, errors caused by manual operation can be avoided, and the problem of disordered program version updating is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings described below are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of a remote server code update system according to an embodiment of the present invention;
fig. 2 is a flowchart of a remote server code updating method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the term "comprising" and other similar meaning in the description of the invention or the claims and the above-mentioned figures is intended to cover a non-exclusive inclusion, such as a process, method or system, apparatus comprising a series of steps or elements, without limitation to the listed steps or elements. Furthermore, "first" and "second" are used to distinguish between different objects and are not used to describe a particular order.
It will be appreciated that rsync is a data mirror backup tool under the linux system that can be synchronized remotely, support local replication, or synchronize with other SSH, rsync hosts using the fast incremental backup tool Remote Sync. GitLab is an open source project for a warehouse management system, uses Git as a code management tool, and builds a Web service on this basis.
Referring to fig. 1, a schematic structure diagram of a remote server code updating system according to an embodiment of the present invention includes:
the operation and maintenance server 110 is used for executing an operation and maintenance script after an operation and maintenance person logs in the server and modifies the execution script parameters according to the name of a pre-deployed project, the ID of a submitted project and the main branch of the Gitlab, automatically logging in the springboard machine server, and displaying the execution process and the result on a terminal interface;
the operation and maintenance server 110 is installed with Python, such as the linux/mac version of Python. The operation and maintenance personnel logs in the operation and maintenance server by using a user name and a password, enters an operation and maintenance script catalog, and modifies the parameters of the execution script according to the names of the product items to be deployed, the corresponding main branches of the gitlab and the corresponding item commit id. After setting script parameters, the operation and maintenance personnel execute the operation and maintenance script to update code synchronization.
Wherein the operation and maintenance server 110 is installed with a fabric automation operation and maintenance tool and a ssh telnet client tool.
Wherein, before executing the operation and maintenance script, the method comprises the following steps:
an automatic operation and maintenance script based on Python is compiled, and the operation and maintenance script at least comprises a code updating function, a remote synchronous copying function, an operation and maintenance log recording function, an item code initialization updating function and a code cleaning function.
When executing the script, the trigger server can display the script executing process and the result on the terminal interface, so that the operation and maintenance personnel can conveniently track the executing state and the result of the script command.
The springboard machine server 120 is used for entering the release project directory, switching to a code production branch, executing a set pull instruction to pull the latest code to the local machine, and synchronizing the code to the project directory of the production server through a rsync command;
the springboard machine server can operate remote equipment by taking the self as a springboard, can receive the instruction sent by the operation and maintenance server, and executes the instruction to perform remote code synchronization. The trigger server is provided with a Git code pulling tool and an rsync synchronization code client tool. The Git tool has the item pulling authority of the Gitlab code library, and the rsync tool has the ssh protocol password-free login authority of the production server.
After finding the production branch corresponding to the code release project, the trigger server directly acquires the latest code and remotely and synchronously updates the project file of the production server.
Wherein, the springboard machine server 120 includes:
and the security audit unit is used for recording the IP of the client logged in the current trigger server, and executing script time and content information.
In the process of executing the operation and maintenance script, the method firstly enters a release item catalog, switches to a code production branch, such as a main branch, then executes a gitpull to pull the latest code to a local machine, and uses rsync to synchronize the code to the item catalog of the production server. And sending an item initialization starting command to the production server, recording and issuing relevant information such as a log and the like, and storing the relevant information into a log file.
The production server 130 is configured to receive the rsync update project code file sent by the springboard server, update the project file directory content, and execute a remote initialization instruction for initialization after the update is completed.
The production server 130 is provided with a Linux operating system, and opens a remote ssh login execution function (accessed by configuring a public-private key in a peer-to-peer mode) of the operation and maintenance server. It can provide application services such as http site, business services, etc.
After receiving rsync update project code file sent by the springboard machine server 120, the production server updates the project file directory content, and executes remote initialization start command sent by the springboard machine server, and after the start is completed, the production server can normally provide service to outside. .
In this embodiment, based on a predefined operation and maintenance script and a springboard machine server, automatic operation and maintenance can be realized, and an operation and maintenance person can execute an issue command on the machine to automatically issue the latest generation code. The time occupation of operation and maintenance personnel can be reduced, the operation and maintenance efficiency is improved, and errors caused by human factors can be avoided. Meanwhile, the information can be timely rolled back and wrongly issued.
Fig. 2 is a flow chart of a remote server code updating method according to an embodiment of the present invention, where the method includes:
s201, logging in an operation server at an operation and maintenance personnel, executing an operation and maintenance script after modifying and executing script parameters according to a pre-deployment project name, a submitted project ID and a Gitlab main branch, automatically logging in a springboard machine server, and displaying an execution process and a result at a terminal interface;
the operation and maintenance server is provided with a fabric automatic operation and maintenance tool and a ssh remote login client tool.
Preferably, before executing the operation and maintenance script, the method includes:
an automatic operation and maintenance script based on Python is compiled, and the operation and maintenance script at least comprises a code updating function, a remote synchronous copying function, an operation and maintenance log recording function, an item code initialization updating function and a code cleaning function.
S202, entering an issue item catalog, switching to a code production branch, executing a Git pull instruction to pull the latest code to a local machine, and synchronizing the code to the item catalog of a production server through an rsync command;
the client IP logged in to the current trigger server, and the execution script time and content information are recorded.
S203, receiving rsync update project code files sent by the springboard machine server, updating project file catalog content, and executing a remote initialization instruction for initialization after the update is completed.
It should be understood that the sequence number of each step in the above embodiment does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiment of the present invention.
It will be appreciated by those skilled in the art that all or part of the steps in the methods of the above embodiments may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program when executed implements part or all of the processes in steps S201 to S203, and the storage medium includes, for example, ROM/RAM.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described system and module may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A remote server code update system, comprising:
the operation and maintenance server is used for executing an operation and maintenance script after an operation and maintenance person logs in the server and modifies the execution script parameters according to the name of the pre-deployed project, the ID of the submitted project and the main branch of the Gitlab, automatically logging in the springboard machine server and displaying the execution process and the result on a terminal interface;
the springboard machine server is used for entering the release project catalog, switching to a code production branch, executing a Git pull instruction to pull the latest code to the self, and synchronizing the code to the project catalog of the production server through an rsync command;
and the production server is used for receiving the rsync updating project code file sent by the springboard machine server, updating the project file catalog content, and executing a remote initialization instruction to initialize after the updating is finished.
2. The system of claim 1, wherein the operation and maintenance server is installed with a fabric automation operation and maintenance tool and a ssh telnet client tool.
3. The system of claim 1, wherein prior to executing the operation and maintenance script comprises:
an automatic operation and maintenance script based on Python is compiled, and the operation and maintenance script at least comprises a code updating function, a remote synchronous copying function, an operation and maintenance log recording function, an item code initialization updating function and a code cleaning function.
4. The system of claim 1, wherein the springboard server comprises:
and the security audit unit is used for recording the IP of the client logged in the current trigger server, and executing script time and content information.
5. A remote server code updating method, comprising:
after an operation and maintenance person logs in an operation and maintenance server and modifies execution script parameters according to a pre-deployment project name, a submitted project ID and a Gitlab main branch, executing an operation and maintenance script, automatically logging in a springboard machine server, and displaying an execution process and a result on a terminal interface;
entering an issued project directory, switching to a code production branch, executing a Git pull instruction to pull the latest code to a local machine, and synchronizing the code to the project directory of a production server through an rsync command;
and receiving rsync updating project code files sent by the trigger server, updating the project file catalog content, and executing a remote initialization instruction for initialization after the updating is completed.
6. The method of claim 5, wherein the operation and maintenance server is installed with a fabric automation operation and maintenance tool and a ssh telnet client tool.
7. The method of claim 5, wherein prior to executing the operation and maintenance script comprises:
an automatic operation and maintenance script based on Python is compiled, and the operation and maintenance script at least comprises a code updating function, a remote synchronous copying function, an operation and maintenance log recording function, an item code initialization updating function and a code cleaning function.
8. The method of claim 5, wherein executing the set pull instruction pulls the latest code to the local machine, synchronizing the code to the project catalog of the production server via the rsync command further comprises:
the client IP logged in to the current trigger server is recorded, as well as the execution script time and content information.
CN202310692174.8A 2023-06-11 2023-06-11 Remote server code updating system and method Pending CN116719546A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310692174.8A CN116719546A (en) 2023-06-11 2023-06-11 Remote server code updating system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310692174.8A CN116719546A (en) 2023-06-11 2023-06-11 Remote server code updating system and method

Publications (1)

Publication Number Publication Date
CN116719546A true CN116719546A (en) 2023-09-08

Family

ID=87867381

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310692174.8A Pending CN116719546A (en) 2023-06-11 2023-06-11 Remote server code updating system and method

Country Status (1)

Country Link
CN (1) CN116719546A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117390655A (en) * 2023-12-06 2024-01-12 和元达信息科技有限公司 Data encryption method and system based on database

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117390655A (en) * 2023-12-06 2024-01-12 和元达信息科技有限公司 Data encryption method and system based on database
CN117390655B (en) * 2023-12-06 2024-03-22 和元达信息科技有限公司 Data encryption method and system based on database

Similar Documents

Publication Publication Date Title
CN104487960B (en) Automated disaster recovery and Data Migration
CN102214128B (en) Repurposable recovery environment
WO2018049983A1 (en) Data synchronization method and system, and synchronization acquisition method and device
CN105824722A (en) Backup restoring system for computer cloud
CN116719546A (en) Remote server code updating system and method
CN114880167A (en) Data backup and recovery method, server, distributed system and storage medium
CN114024951B (en) Cloud edge collaboration-based power edge heterogeneous deployment method
US20120324436A1 (en) Method of updating versioned software using a shared cache
CN104899116A (en) Data backup method, source server, target server and system
EP2542976A1 (en) Method and apparatus of backing-up subversion repository
US11372727B2 (en) Method, device, and computer-readable storage medium for managing storage system
CN111125060B (en) Database management method, system, equipment and storage medium
CN112291081B (en) Method, system and storage medium for auditing controller cluster data by cloud management platform
CN113986871A (en) Data migration method and device, server and readable storage medium
CN116149713B (en) Program upgrading method and device for all-level equipment under tree-type heterogeneous network
CN117762474A (en) Database high availability software management method, device and system
CN111813683A (en) Universal automatic software test environment synchronization method
CN113515574B (en) Data synchronization method and device
CN111966532B (en) Database management method and device, electronic equipment and medium
CN101155061B (en) Master/standby control method
CN113992698A (en) Intelligent device management method, gateway and computer readable storage medium
CN113938382A (en) Cluster management method, system and storage medium based on pacemaker
CN112925544B (en) Method and device for updating application program, electronic equipment and computer storage medium
CN112764967B (en) ORACLE database system, database environment deployment method and database switching method
CN113946470A (en) MongoDB database backup and recovery method

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