CN111142932A - Parameter configuration method and device - Google Patents

Parameter configuration method and device Download PDF

Info

Publication number
CN111142932A
CN111142932A CN201911417336.7A CN201911417336A CN111142932A CN 111142932 A CN111142932 A CN 111142932A CN 201911417336 A CN201911417336 A CN 201911417336A CN 111142932 A CN111142932 A CN 111142932A
Authority
CN
China
Prior art keywords
configuration file
environment
environment configuration
file
end project
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
CN201911417336.7A
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201911417336.7A priority Critical patent/CN111142932A/en
Publication of CN111142932A publication Critical patent/CN111142932A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

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

Abstract

The invention discloses a parameter configuration method and a device, wherein the method comprises the following steps: and adding an environment configuration file in a root directory of the front-end project, wherein the environment configuration file is used for configuring parameters of all environments deployed by the front-end project. Establishing a corresponding relation between a packaging instruction and an environment configuration file in a front-end project configuration file; adding configuration parameters corresponding to the environment configuration file; and according to the target packaging instruction, combining the corresponding relation between the packaging instruction and the environment configuration file to obtain the environment configuration file and the configuration parameters corresponding to the environment to be processed. When the environment needs to be switched among the environments, the environment configuration file and the configuration parameters corresponding to the environment to be processed can be obtained according to the target packaging instruction only by sending the target packaging instruction, the code writing is not required to be rewritten, the workload of workers is reduced, and the working efficiency is high.

Description

Parameter configuration method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a parameter configuration method and apparatus.
Background
In the front-end project development process, local development, test scripts, development self-tests, test environments, pre-online environments and the like are generally performed, and then the front-end project can be formally released. In this process, there are differences between the respective environments, mainly reflected in: server addresses, interface addresses, websorkey addresses, etc. when switching between various environments is required, different configuration parameters need to be selected for different addresses.
Particularly, in a continuous integration environment, environments such as assembly test, functional test and the like can exist at the same time, while in the prior art, different sets of codes are generally written for different environments in the process of front-end project development, when switching is required among the environments, configuration parameters in configuration files need to be rewritten for the to-be-switched environments, so that the workload of workers is increased, and the working efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a parameter configuration method, which is used for reducing the workload of workers and improving the working efficiency and comprises the following steps:
adding an environment configuration file in a root directory of a front-end project, wherein the environment configuration file is used for configuring parameters of all environments deployed by the front-end project;
establishing a corresponding relation between a packaging instruction and the environment configuration file in a front-end project configuration file;
adding configuration parameters corresponding to the environment configuration file;
and according to the target packaging instruction, combining the corresponding relation between the packaging instruction and the environment configuration file to obtain the environment configuration file and the configuration parameters corresponding to the environment to be processed.
Optionally, the front-end item is a vue.
Optionally, the method further includes:
packaging and compiling the environment configuration files corresponding to the environment to be processed;
and issuing the packaged and compiled environment configuration file to a preset server.
Optionally, the method further includes:
and correcting the packaged and compiled environment configuration file by using the Git server.
The embodiment of the invention also provides a parameter configuration device, which is used for reducing the workload of workers and improving the working efficiency and comprises the following components:
the file adding module is used for adding an environment configuration file in a root directory of the front-end project, and the environment configuration file is used for configuring parameters of all environments deployed by the front-end project;
the relation corresponding module is used for establishing the corresponding relation between the packaging instruction and the environment configuration file in the front-end project configuration file;
the parameter adding module is used for adding configuration parameters corresponding to the environment configuration files into the environment configuration files;
and the parameter configuration module is used for acquiring the environment configuration file and the configuration parameters corresponding to the environment to be processed according to the target packaging instruction and by combining the corresponding relation between the packaging instruction and the environment configuration file.
Optionally, the front-end item is a vue.
Optionally, the apparatus further comprises:
the packaging compiling module is used for packaging and compiling the environment configuration file corresponding to the environment to be processed;
and the publishing module is used for publishing the packaged and compiled environment configuration file to a preset server.
Optionally, the apparatus further comprises:
and the file correction module is used for correcting the packaged and compiled environment configuration file by using the Git server.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program for executing the above method is stored.
In the embodiment of the invention, the environment configuration file for configuring the parameters of all environments deployed on the front-end project is added in the root directory of the front-end project, the corresponding relation between the packaging instruction and the environment configuration file is established in the front-end project configuration file, the configuration parameters corresponding to the environment configuration file are added in the environment configuration file, when the switching between the environments is required, the environment configuration file and the configuration parameters corresponding to the environment to be processed can be obtained according to the target packaging instruction only by sending the target packaging instruction, the code rewriting is not required, the workload of workers is reduced, and the working efficiency is higher.
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 described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flow chart of a parameter configuration method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a parameter configuration method according to an embodiment of the present invention;
FIG. 3 is a further flowchart of a parameter configuration method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a parameter configuration apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another configuration of a parameter configuration apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of another configuration of a parameter configuration 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 more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
In the front-end project development process, local development, test scripts, development self-tests, test environments, pre-online environments and the like are generally performed, and then the front-end project can be formally released. In this process, there are differences between the respective environments, mainly reflected in: server addresses, interface addresses, websorkey addresses, etc. when switching between various environments is required, different configuration parameters need to be selected for different addresses.
In particular, in a continuous integration environment, environments such as an assembly test and a functional test may exist at the same time, whereas in the prior art, a different set of codes is generally written for different environments in a front-end project development process, and when switching between the environments is required, configuration parameters in a configuration file need to be rewritten for the environment to be switched, so that workload of workers is increased, and work efficiency is low, in order to solve the above problem, fig. 1 shows a flowchart of a parameter configuration method provided by an embodiment of the present invention, and as shown in fig. 1, the method includes:
step 101, adding an environment configuration file in a root directory of a front-end project, wherein the environment configuration file is used for configuring parameters of all environments deployed by the front-end project.
In specific implementation, the environment configuration file can adopt an env file. Wherein env is an external command for displaying the environment variable of the current user.
The env file, which configures the parameters of all the environments of the front-end project deployment, may be added in the root directory of the front-end project, as an example.
Env. local files are added to the root directory of the front-end project, parameters of all environments for deploying the front-end project are configured, and the difference of env is that the files are only in local and cannot be tracked by the Git server.
Add an env. [ mode ] file in the root directory of the front-end item, configure a specific environment mode, such as: env. level to configure the configuration of the development environment.
An env [ mode ] local file is added to a root directory, a specific environment mode is configured, the difference from the env [ mode ] is only effective locally, and the file cannot be tracked by a Git server.
And 102, establishing a corresponding relation between the packaging instruction and the environment configuration file in the front-end project configuration file.
In an embodiment, the front-end item may be a vue. Js refers to a set of progressive frames that build a user interface.
For the packing instruction, for example, the packing instruction corresponding to the packing instruction of the development environment is: "build: level "of the object.
Step 103, adding configuration parameters corresponding to the environment configuration file into the environment configuration file.
And step 104, acquiring an environment configuration file and configuration parameters corresponding to the environment to be processed according to the target packaging instruction and by combining the corresponding relation between the packaging instruction and the environment configuration file.
As can be seen from fig. 1, by adding an environment configuration file configured with parameters of all environments deployed for a front-end project into a root directory of the front-end project, establishing a correspondence between a packaging instruction and the environment configuration file in the front-end project configuration file, and adding a configuration parameter corresponding to the environment configuration file into the environment configuration file, when switching between the environments is required, only a target packaging instruction needs to be sent, the environment configuration file and the configuration parameter corresponding to the environment to be processed can be obtained according to the target packaging instruction, a code does not need to be rewritten, workload of a worker is reduced, and work efficiency is high.
In order to complete the publishing of the preset environment configuration file smoothly, fig. 2 shows another flowchart of a parameter configuration method provided by an embodiment of the present invention, and as shown in fig. 2, the method further includes:
step 201, packaging and compiling the environment configuration file corresponding to the environment to be processed.
Step 202, issuing the packaged and compiled environment configuration file to a preset server.
In order to ensure the correctness of the packaged and compiled environment configuration file, fig. 3 shows a further flowchart of a parameter configuration method provided by the embodiment of the present invention, and as shown in fig. 3, the method further includes:
and 301, correcting the packaged and compiled environment configuration file by using the Git server.
Among them, Git is an open-source distributed version control system, and can effectively process the version management of projects from very small to very large at high speed. In this embodiment, the Git server's correction of the packaged and compiled environment configuration file includes not only correction of its version, but also error reporting of error codes in the environment configuration file.
Based on the same inventive concept, the embodiment of the present invention further provides a parameter configuration apparatus, as described in the following embodiments. Because the principle of the parameter configuration device for solving the problem is similar to the parameter configuration method, the implementation of the parameter configuration device can refer to the implementation of the parameter configuration method, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a schematic structural diagram of a parameter configuration apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus includes:
the file adding module 401 is configured to add an environment configuration file in a root directory of the front-end project, where the environment configuration file is used to configure parameters of all environments deployed by the front-end project.
A relationship correspondence module 402, configured to establish a correspondence between the packaging instruction and the environment configuration file in the front-end project configuration file.
A parameter adding module 403, configured to add configuration parameters corresponding to the environment configuration file.
And the parameter configuration module 404 is configured to obtain, according to the target packaging instruction and in combination with the corresponding relationship between the packaging instruction and the environment configuration file, an environment configuration file and configuration parameters corresponding to the environment to be processed.
In the embodiment of the present invention, the front-end item is a vue.
Fig. 5 is a schematic structural diagram of a parameter configuration apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus further includes:
and the packaging and compiling module 501 is configured to package and compile the environment configuration file corresponding to the to-be-processed environment.
The publishing module 502 is configured to publish the packaged and compiled environment configuration file to a preset server.
Fig. 6 is a schematic structural diagram of a parameter configuration apparatus according to an embodiment of the present invention, and as shown in fig. 6, the apparatus further includes:
and the file correction module 601 is configured to correct the packaged and compiled environment configuration file by using the Git server.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the above method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program for executing the above method is stored.
In summary, according to the invention, by establishing the corresponding relationship between the packaging instruction and the environment configuration file in the front-end project configuration file, and adding the configuration parameters corresponding to the environment configuration file, when switching between the environments is required, only the target packaging instruction needs to be sent, and the environment configuration file and the configuration parameters corresponding to the environment to be processed can be obtained according to the target packaging instruction, and code rewriting is not required, so that the workload of workers is reduced, and the working efficiency is high. In addition, the invention can be suitable for the deployment of multi-environment continuous integration environment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for configuring parameters, comprising:
adding an environment configuration file in a root directory of a front-end project, wherein the environment configuration file is used for configuring parameters of all environments deployed by the front-end project;
establishing a corresponding relation between a packaging instruction and the environment configuration file in a front-end project configuration file;
adding configuration parameters corresponding to the environment configuration file;
and according to the target packaging instruction, combining the corresponding relation between the packaging instruction and the environment configuration file to obtain the environment configuration file and the configuration parameters corresponding to the environment to be processed.
2. The method of claim 1, wherein the front-end item is a vue.
3. The method of claim 1, further comprising:
packaging and compiling the environment configuration files corresponding to the environment to be processed;
and issuing the packaged and compiled environment configuration file to a preset server.
4. The method of claim 3, further comprising:
and correcting the packaged and compiled environment configuration file by using the Git server.
5. An apparatus for parameter configuration, comprising:
the file adding module is used for adding an environment configuration file in a root directory of the front-end project, and the environment configuration file is used for configuring parameters of all environments deployed by the front-end project;
the relation corresponding module is used for establishing the corresponding relation between the packaging instruction and the environment configuration file in the front-end project configuration file;
the parameter adding module is used for adding configuration parameters corresponding to the environment configuration files into the environment configuration files;
and the parameter configuration module is used for acquiring the environment configuration file and the configuration parameters corresponding to the environment to be processed according to the target packaging instruction and by combining the corresponding relation between the packaging instruction and the environment configuration file.
6. The apparatus of claim 5, wherein the front-end item is a vue.
7. The apparatus of claim 5, further comprising:
the packaging compiling module is used for packaging and compiling the environment configuration file corresponding to the environment to be processed;
and the publishing module is used for publishing the packaged and compiled environment configuration file to a preset server.
8. The apparatus of claim 7, further comprising:
and the file correction module is used for correcting the packaged and compiled environment configuration file by using the Git server.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
CN201911417336.7A 2019-12-31 2019-12-31 Parameter configuration method and device Pending CN111142932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911417336.7A CN111142932A (en) 2019-12-31 2019-12-31 Parameter configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911417336.7A CN111142932A (en) 2019-12-31 2019-12-31 Parameter configuration method and device

Publications (1)

Publication Number Publication Date
CN111142932A true CN111142932A (en) 2020-05-12

Family

ID=70522851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911417336.7A Pending CN111142932A (en) 2019-12-31 2019-12-31 Parameter configuration method and device

Country Status (1)

Country Link
CN (1) CN111142932A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923119A (en) * 2021-10-09 2022-01-11 中国银行股份有限公司 Method and device for checking configuration parameters constructed by Maven project
CN115016785A (en) * 2022-08-09 2022-09-06 杭州湛联科技有限公司 Front-end item packaging method and device for multi-environment sharing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049457A (en) * 1996-07-30 1998-02-20 Nec Corp Destination switchable network system, destination switching method and storage medium storing destination switching program
CN109241469A (en) * 2018-09-13 2019-01-18 安徽智恒信科技有限公司 A method of multi-page switching is realized based on vue
CN109828779A (en) * 2018-12-26 2019-05-31 中国平安人寿保险股份有限公司 Environment changing method, apparatus, terminal installation and storage medium
CN109976619A (en) * 2019-03-27 2019-07-05 携程计算机技术(上海)有限公司 The switching system and method for wechat small routine running environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049457A (en) * 1996-07-30 1998-02-20 Nec Corp Destination switchable network system, destination switching method and storage medium storing destination switching program
CN109241469A (en) * 2018-09-13 2019-01-18 安徽智恒信科技有限公司 A method of multi-page switching is realized based on vue
CN109828779A (en) * 2018-12-26 2019-05-31 中国平安人寿保险股份有限公司 Environment changing method, apparatus, terminal installation and storage medium
CN109976619A (en) * 2019-03-27 2019-07-05 携程计算机技术(上海)有限公司 The switching system and method for wechat small routine running environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邓雯婷: "基于 Vue.js 构建单页面 GIS 应用的方法研究" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923119A (en) * 2021-10-09 2022-01-11 中国银行股份有限公司 Method and device for checking configuration parameters constructed by Maven project
CN115016785A (en) * 2022-08-09 2022-09-06 杭州湛联科技有限公司 Front-end item packaging method and device for multi-environment sharing

Similar Documents

Publication Publication Date Title
CN108897547B (en) Software automation deployment method and device
CN111142932A (en) Parameter configuration method and device
US9824000B1 (en) Testing calling code dynamically with random error injection based on user-specified configuration
CN111158655B (en) Deployment method and device of software running environment
CN105653261A (en) Development integration test method and system on the basis of cloud computing environment
CN107179982B (en) Cross-process debugging method and device
CA3155732A1 (en) Business process configuring method, business request processing method, and devices
CN104461649A (en) Chip compatible method and device
CN113010180A (en) Firmware generation method, system, device and medium
CN110647349B (en) Method for realizing continuous delivery of iOS APP
CN113032104A (en) Method and device for deploying k8s container application
CN111562942A (en) Gitlab-based mobile APP continuous integration device and method
CN109508193B (en) Application deployment and operation method, device, terminal equipment and medium
CN111880507A (en) Method and device for online debugging of alternating current fault ride-through characteristic and storage medium
CN104965719A (en) Method and apparatus for generating an application installation file
JP5906609B2 (en) Debug support program, debug support method, and debug support system
CN104750482A (en) Method for constructing dynamic script execution engine based on MapReduce
CN106547519B (en) Information processing method and system
US20170090984A1 (en) Progress visualization of computational job
CN112035439A (en) Data migration method and device, computer equipment and computer readable storage medium
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN112130962A (en) Continuous delivery platform and method for deploying application system by using same
CN111913720A (en) Program deployment method and device
US10768597B2 (en) Method and controller for flexible process control
CN113722049A (en) Multi-server timing task starting 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