CN116243927A - Micro-service item code configuration method and system based on Gitlab - Google Patents
Micro-service item code configuration method and system based on Gitlab Download PDFInfo
- Publication number
- CN116243927A CN116243927A CN202211564797.9A CN202211564797A CN116243927A CN 116243927 A CN116243927 A CN 116243927A CN 202211564797 A CN202211564797 A CN 202211564797A CN 116243927 A CN116243927 A CN 116243927A
- Authority
- CN
- China
- Prior art keywords
- micro
- code
- service
- gitlab
- codes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/445—Exploiting fine grain parallelism, i.e. parallelism at instruction level
- G06F8/4452—Software pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version 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)
Abstract
The invention belongs to the field of micro-service item code configuration, and provides a method and a system for configuring micro-service item codes based on Gitlab. The method comprises the steps of obtaining service codes and operation and maintenance codes; splitting the business code and the operation and maintenance code into different micro-service items based on Gitlab; and automatically completing the deployment of the micro service items by referring to codes among the micro service items. The method reduces the invasion of the automatic deployment related codes to project codes, reduces the development difficulty and improves the code safety; the maintenance difficulty of the CI/CD assembly line is reduced, the operation and maintenance work flow is simplified, and the online efficiency of the project is prompted; by using the code organization management architecture, the code development working efficiency is improved, the code quality is higher, and the stability of the production environment is improved.
Description
Technical Field
The invention belongs to the field of micro-service item code configuration, and particularly relates to a method and a system for configuring micro-service item codes based on Gitlab.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Gitlab is a widely used open source enterprise code repository management platform that manages code and documents primarily from two dimensions, group and Project, where Group is a Group, project is an engineering Project, and a Group can manage multiple projects. Typically, a micro-service item is placed in a Group during construction and a plurality of micro-service sub-items Project are created in the Group. CI/CD means sustainable integration and continuous deployment, the currently mainstream CI/CD tool is jenkins, but given the fact that jenkins linkage gitlab needs to configure plug-ins and given the fact that currently widely used gitlab for version management, the matching of gitlab-CI with automatic deployment schemes is becoming a better alternative. The use of Gitlab-CI as CI/CD requires creation of a. Gitlab-CI. Yml in Project, and other files if CI/CD flow is complex, creates intrusion into the micro-service Project code, and is inconvenient for the DevOps personnel to maintain.
Disclosure of Invention
In order to solve the technical problems in the background art, the invention provides a method and a system for configuring micro service item codes based on Gitlab, which can reduce the difficulty of CI/CD maintenance, improve the code quality and improve the working efficiency.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
the first aspect of the present invention provides a method for configuring a micro service item code based on a Gitlab.
A method for micro-service item code configuration based on Gitlab, comprising:
acquiring a service code and an operation and maintenance code;
splitting the business code and the operation and maintenance code into different micro-service items based on Gitlab;
and automatically completing the deployment of the micro service items by referring to codes among the micro service items.
In one embodiment, in the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the business codes and the operation and maintenance codes corresponding to each business process link are split into matched micro-service items based on the Gitlab according to the business process links.
As an embodiment, before splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab, the method further comprises:
a Group is created in Gitlab for storing items of micro services.
In one embodiment, in splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab, project of each sub-item of the micro-service item is created in the Group, and the Project is used for storing the business code corresponding to the item.
In one embodiment, in splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab, a Project detail of the deployed micro-service item is created in the Group for storing the corresponding operation and maintenance code of the item.
As one embodiment, the process of automatically completing the deployment of the micro service items by means of the reference codes among the micro service items comprises the following steps:
constructing a pipeline of the CI/CD in a Project detail of the micro service deployment Project, and configuring a CI/CD universal component template;
and referencing a CI/CD universal component template in each micro-service sub-Project, triggering a pipeline of the CI/CD of the downstream micro-service deployment Project, and completing the deployment of the micro-service Project by triggering authentication to acquire the authority of the deployment service in the pipeline of the deployment Project.
A second aspect of the present invention provides a Gitlab-based micro service item code configuration system.
A Gitlab-based micro-service project code configuration system, comprising:
the code acquisition module is used for acquiring service codes and operation and maintenance codes;
a code splitting module for splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab;
and the code reference module is used for automatically completing the deployment of the micro-service items by referring to codes among the micro-service items.
In one embodiment, in the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the business codes and the operation and maintenance codes corresponding to each business process link are split into matched micro-service items based on the Gitlab according to the business process links.
A third aspect of the present invention provides a computer-readable storage medium.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps in a method of a Gitlab-based micro-service project code configuration as described above.
A fourth aspect of the invention provides an electronic device.
An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the method for the distribution of a micro-service item code based on a Gitlab as described above when the program is executed by the processor.
Compared with the prior art, the invention has the beneficial effects that:
according to the invention, the business codes and the operation and maintenance codes are split into different projects through the Gitlab, and the process of automatic deployment is completed in a mode of referencing codes among the projects, so that the invasion of the related codes of the automatic deployment to the project codes is reduced, the development difficulty is reduced, and the code safety is improved; the maintenance difficulty of the CI/CD assembly line is reduced, the operation and maintenance work flow is simplified, and the online efficiency of the project is prompted; by using the code organization management architecture, the code development working efficiency is improved, the code quality is higher, and the stability of the production environment is improved.
Additional aspects of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a flow chart of a method for configuring a micro service item code based on Gitlab according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the organization and management of micro service item codes according to an embodiment of the present invention.
Detailed Description
The invention will be further described with reference to the drawings and examples.
It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
Example 1
Referring to fig. 1, the present embodiment provides a method for configuring a micro service item code based on a Gitlab, which specifically includes the following steps:
step 1: and acquiring service codes and operation and maintenance codes.
Step 2: the business code and the operation and maintenance code are split into different micro-service items based on the Gitlab.
Specifically, in the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the business codes and the operation and maintenance codes corresponding to each business process link are split into the matched micro-service items based on the Gitlab according to the business process links.
In a specific implementation process, before splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab, the method further comprises:
a Group is created in Gitlab for storing items of micro services.
In an implementation, a Group is created by a Group name and a link.
Specifically, in the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the Project of each sub-item of the micro-service item is created in the Group and used for storing the business codes corresponding to the items.
In the process of splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab, a Project detail for deploying the micro-service items is created in the Group and used for storing the corresponding operation and maintenance codes of the items.
Step 3: and automatically completing the deployment of the micro service items by referring to codes among the micro service items.
Wherein, the process of automatically completing the deployment of the micro service items by referring to codes among the micro service items comprises the following steps:
constructing a pipeline of the CI/CD in a Project detail of the micro service deployment Project, and configuring a CI/CD universal component template;
and referencing a CI/CD universal component template in each micro-service sub-Project, triggering a pipeline of the CI/CD of the downstream micro-service deployment Project, and completing the deployment of the micro-service Project by triggering authentication to acquire the authority of the deployment service in the pipeline of the deployment Project.
The pipeline of the CI/CD is constructed in the Project of each micro-service sub-item, and the construction process is the same as that of the CI/CD, and is responsible for constructing a mirror image and transmitting variables.
The pipeline of each micro-service sub-Project references the common template of the CI/CD and configures the pipeline that triggers the downstream micro-service deployment Project.
By triggering Token of the pipeline of micro-service deployment items. The Token is authentication of the K8s cluster, creates a new agent in the InfraStructure/Kubernetes clusters of the project, generates a K8s deployment command with a key, executes the command in the target cluster, and creates an authentication service. The pipeline of the micro service sub-item can trigger a downstream deployment item pipeline, and in the deployment item pipeline, the micro service item is deployed by triggering authentication to acquire the authority of the deployment service.
The organization and management structure of the micro service item codes is shown in fig. 2, sub-items of the micro service are placed in the same Group, an item for configuring a CI/CD template and deploying the micro service is created in the Group, and each sub-item of the micro service refers to the template for deploying the item and invokes the deployment item to deploy the service.
According to the embodiment, the invasion of the automatic deployment related codes to project codes is reduced, the development difficulty is reduced, and the code safety is improved; the maintenance difficulty of the CI/CD assembly line is reduced, the operation and maintenance work flow is simplified, and the online efficiency of the project is prompted; by using the code organization management architecture, the code development working efficiency is improved, the code quality is higher, and the stability of the production environment is improved.
Example two
The present embodiment provides a micro service item code configuration system based on a Gitlab, which includes:
the code acquisition module is used for acquiring service codes and operation and maintenance codes;
a code splitting module for splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab;
and the code reference module is used for automatically completing the deployment of the micro-service items by referring to codes among the micro-service items.
In the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the business codes and the operation and maintenance codes corresponding to each business process link are split into the matched micro-service items based on the Gitlab according to the business process links.
It should be noted that, each module in the embodiment corresponds to each step in the first embodiment one to one, and the implementation process is the same, which is not described here.
Example III
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps in the Gitlab-based micro service item code configuration method as described above.
Example IV
The present embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the steps in the method for configuring a micro service item code based on a Gitlab described above are implemented when the processor executes the program.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. The method for configuring the micro-service item codes based on the Gitlab is characterized by comprising the following steps of:
acquiring a service code and an operation and maintenance code;
splitting the business code and the operation and maintenance code into different micro-service items based on Gitlab;
and automatically completing the deployment of the micro service items by referring to codes among the micro service items.
2. The method for configuring micro-service item codes based on Gitlab as claimed in claim 1, wherein in the process of splitting the business codes and the operation and maintenance codes into different micro-service items based on the Gitlab, the business codes and the operation and maintenance codes corresponding to each business process link are split into the matched micro-service items based on the Gitlab according to the business process links.
3. The method for providing a micro service item code based on Gitlab as claimed in claim 1, further comprising, before splitting the business code and the operation and maintenance code into different micro service items based on Gitlab:
a Group is created in Gitlab for storing items of micro services.
4. A method for configuring a micro service item code based on a Gitlab as claimed in claim 3, wherein in splitting the service code and the operation and maintenance code into different micro service items based on the Gitlab, the Project of each sub-item of the micro service item is created in the Group for storing the service code corresponding to the item.
5. A method for configuring a micro service item code based on Gitlab as claimed in claim 3, wherein in splitting the business code and the operation and maintenance code into different micro service items based on Gitlab, a Project detail for deploying the micro service item is created in the Group for storing the corresponding operation and maintenance code of the item.
6. The method for configuring micro-service item codes based on Gitlab as recited in claim 5, wherein the process of automatically completing the deployment of the micro-service items by means of the reference codes between the micro-service items comprises:
constructing a pipeline of the CI/CD in a Project detail of the micro service deployment Project, and configuring a CI/CD universal component template;
and referencing a CI/CD universal component template in each micro-service sub-Project, triggering a pipeline of the CI/CD of the downstream micro-service deployment Project, and completing the deployment of the micro-service Project by triggering authentication to acquire the authority of the deployment service in the pipeline of the deployment Project.
7. A Gitlab-based micro service project code configuration system comprising:
the code acquisition module is used for acquiring service codes and operation and maintenance codes;
a code splitting module for splitting the business code and the operation and maintenance code into different micro-service items based on the Gitlab;
and the code reference module is used for automatically completing the deployment of the micro-service items by referring to codes among the micro-service items.
8. The micro service item code configuration system according to claim 5, wherein in splitting the business code and the operation and maintenance code into different micro service items based on the Gitlab, the business code and the operation and maintenance code corresponding to each business process link are split into the matched micro service items based on the Gitlab according to the business process links.
9. A computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method for the distribution of micro service item codes based on Gitlab as claimed in any one of claims 1 to 6.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the program, performs the steps in the method of the Gitlab-based micro-service item code configuration of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211564797.9A CN116243927A (en) | 2022-12-07 | 2022-12-07 | Micro-service item code configuration method and system based on Gitlab |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211564797.9A CN116243927A (en) | 2022-12-07 | 2022-12-07 | Micro-service item code configuration method and system based on Gitlab |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116243927A true CN116243927A (en) | 2023-06-09 |
Family
ID=86624942
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211564797.9A Pending CN116243927A (en) | 2022-12-07 | 2022-12-07 | Micro-service item code configuration method and system based on Gitlab |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116243927A (en) |
-
2022
- 2022-12-07 CN CN202211564797.9A patent/CN116243927A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11340870B2 (en) | Software release workflow management | |
CN105893050B (en) | Method for carrying out full-life-cycle management on software project based on PLMS, SVN and Jenkins | |
EP2482192B1 (en) | Testing lifecycle | |
US8522207B1 (en) | Systems and methods for automated centralized build/merge management | |
CN108845940B (en) | Enterprise-level information system automatic function testing method and system | |
CN111324522A (en) | Automatic test system and method | |
CN110389766B (en) | HBase container cluster deployment method, system, equipment and computer readable storage medium | |
CN110795709A (en) | Method and device for performing business operation, electronic equipment and storage medium | |
CN111679888A (en) | Deployment method and device of agent container | |
CN111641516B (en) | On-line reconfiguration of nodes in a process control system | |
CN115630835A (en) | Activity-based workflow general parameter configuration method and system | |
CN111181775A (en) | Integrated operation and maintenance management alarm method based on automatic host asset discovery | |
CN117806654A (en) | Tekton-based custom cloud native DevOps pipeline system and method | |
CN111562942B (en) | Gitlab-based mobile APP continuous integration device and method | |
CN112564979A (en) | Execution method and device for construction task, computer equipment and storage medium | |
CN116243927A (en) | Micro-service item code configuration method and system based on Gitlab | |
CN104423963A (en) | Control program management device, information processing device, and control program processing method | |
CN115185489B (en) | Time sequence data algorithm configuration system and method | |
CN111026569A (en) | Method for repairing designated block data in alliance chain | |
CN109656740A (en) | A method of supporting timeout treatment task flow | |
CN114265595B (en) | Cloud native application development and deployment system and method based on intelligent contracts | |
CN109947645A (en) | Automatic configuration tool method and system | |
CN115271764A (en) | Safety management and control method and system for smart phone maintenance | |
CN114371881A (en) | Flexible and safe CI/CD service deployment system and method based on gitlab-CI | |
CN114493493A (en) | Decision engine and decision engine implementation 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 |