CN117693734A - Front-end item processing method, device, equipment, management system and storage medium - Google Patents

Front-end item processing method, device, equipment, management system and storage medium Download PDF

Info

Publication number
CN117693734A
CN117693734A CN202180075173.8A CN202180075173A CN117693734A CN 117693734 A CN117693734 A CN 117693734A CN 202180075173 A CN202180075173 A CN 202180075173A CN 117693734 A CN117693734 A CN 117693734A
Authority
CN
China
Prior art keywords
target
construction
source code
target source
dependent
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
CN202180075173.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.)
Bigo Technology Singapore Pte Ltd
Original Assignee
Bigo Technology Singapore Pte 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 Bigo Technology Singapore Pte Ltd filed Critical Bigo Technology Singapore Pte Ltd
Publication of CN117693734A publication Critical patent/CN117693734A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

Front-end item processing methods, apparatuses, devices, management systems, and storage media are disclosed herein. The front-end item processing method comprises the following steps: acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed; performing construction operation based on the target source code to obtain a construction product corresponding to the target item, wherein the construction product comprises a plurality of webpage files corresponding to the service lines respectively and public static resources corresponding to the service lines; and the construction products are classified and released to a server.

Description

Front-end item processing method, device, equipment, management system and storage medium
The present application claims priority from the chinese patent office, chinese patent application number 202011457915.7, filed on month 12 and 10 of 2020, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of computer technology, for example, to a front-end item processing method, apparatus, device, management system, and storage medium.
Background
With the rapid development of internet technology, the service scope of many internet companies is becoming wider, and different application programs can be developed for different service lines. Each business line in the company has its own development flow, and developers of different business lines may use similar development modes and similar construction tools, but there are some differences between different business lines.
To meet the user's use needs, the internet company will often add new functions, such as putting on line new activities or playing methods, where the same playing method may need to be used on different service lines at the same time, and the playing method may correspond to one or more pages, and each page may be developed as a separate project. In the development scheme, development is required for each service line, so that each project needs to be developed for a plurality of times, or after the development is completed on one service line, codes are copied from a code warehouse of the service line to a code warehouse of another service line, and then the codes are modified to be matched with the codes of the other service line. Such migration still takes some time to complete and, since the code is split into two sets, two sets of code need to be maintained simultaneously in subsequent update iterations.
Therefore, when similar development requirements exist in a plurality of business lines, the development process is tedious, time-consuming and low in efficiency, and needs improvement.
Disclosure of Invention
The application provides a front-end project processing method, a front-end project processing device, front-end project processing equipment, a front-end project processing management system and a front-end project processing storage medium, and can simplify development schemes of similar projects of a plurality of business lines.
The application provides a front-end project processing method, which comprises the following steps:
acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed;
performing construction operation based on the target source code to obtain a construction product corresponding to the target item, wherein the construction product comprises a plurality of webpage files corresponding to the service lines respectively and public static resources corresponding to the service lines;
and the construction products are classified and released to a server.
The application provides a front-end item processing device, the device includes:
the target source code acquisition module is used for acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed;
the project construction module is configured to perform construction operation based on the target source code to obtain a construction product corresponding to the target project, wherein the construction product comprises a plurality of webpage files corresponding to the plurality of service lines respectively and public static resources corresponding to the plurality of service lines;
And the construction product issuing module is used for issuing the construction products in a classified manner to the server.
The application provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the front-end project processing method when executing the computer program.
The application provides a project management system, which comprises computer equipment, a warehouse management system and a server, wherein the computer equipment, the warehouse management system and the server are provided, the warehouse management system is arranged to store a warehouse in a management target source code, and the server is arranged to store a construction product received by a server.
The present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the front-end item processing method described above.
Drawings
Fig. 1 is a flow chart of a front-end project processing method provided in an embodiment of the present application;
FIG. 2 is a flowchart of another front-end processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a project construction process according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another front-end processing method according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a project development and construction process according to an embodiment of the present application;
FIG. 6 is a block diagram of a front-end processing device according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present application is described below with reference to the drawings and examples. The specific embodiments described herein are merely illustrative of the application. For convenience of description, only parts relevant to the present application are shown in the drawings.
Fig. 1 is a flow chart of a front-end project processing method provided in an embodiment of the present application, where the method may be performed by a front-end project processing apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated into a computer device. Alternatively, a building script may be written, and the method in the embodiment of the present application is implemented by executing the building script. As shown in fig. 1, the method includes:
step 101, obtaining target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed.
For example, an internet company may develop different applications for different business lines. For example, the same internet company may have a short video service, a live broadcast service, a personalized video recommendation service, and the like at the same time, and different application programs may be developed for users for different service lines respectively, that is, each application program may be considered to correspond to one service line, where the application program may be an independently running application program installed in a terminal and capable of accessing an internet webpage, or may be a webpage (Web) application program accessed through a browser. The target source codes corresponding to the plurality of service lines in the embodiment of the application can also be understood as target source codes corresponding to different application programs, namely source codes developed for different application programs. When application development is performed, one page or webpage may correspond to one item.
Each business line has its own development flow, and developers of different business lines may use similar development modes and similar construction tools, but there are some differences between different business lines. For different business lines, there is sometimes a need to add similar functions, for example, new activities or playing methods may be added, at this time, the same playing method may need to be used on different business lines at the same time, the playing method may correspond to one or more web pages, each web page may be developed as a separate item and applied to multiple application programs, and the item with the development requirement may be the target item in the embodiment of the present application, that is, the target item in the embodiment of the present application may be understood as any one or more items existing in multiple business lines and having personalized differences for different business lines.
By way of example, the source deposit repository may exist in a repository management system, and the implementation manner and type of the repository management system are not limited in the embodiments of the present application, and may be, for example, a Gitlab. The Gitlab is an open source project for a warehouse management system, uses the git as a code management tool and builds web services on the basis of the git, provides functional convenient management projects such as group (group), project (project) warehouse and the like, and provides a runner tool to help build. Alternatively, the build script may be executed by a runner. The target source code storage warehouse can be understood as a source code storage warehouse corresponding to the target item. Optionally, in the warehouse management system, each item corresponds to an independent source code storage warehouse, and the warehouse management system is realized in a group mode, for example, a gitlab group contains all the items, so that the warehouse volume can be effectively reduced, when a user (i.e. a developer) needs to pull the source code of the current item, only the code of the current item can be pulled from the warehouse corresponding to the current item, the pulling efficiency is improved, while in the related art, all the items are stored in one warehouse, the warehouse volume is larger and larger over time, and all the items need to be pulled down every time when the code is pulled, so that the complex and time-consuming operation is realized.
For example, the warehouse management system may further include a template warehouse, a developer may write a code (act_demo) of an initialization project in advance and store the code in the template warehouse, and when one project needs to be developed, before the developer performs development, the front-end scaffold tool (e.g. fed-cli, etc.) may be used to pull the code in the act_demo locally, as an initial code of a new project, and create a corresponding source code storage warehouse in the warehouse management system in a remote manner. A developer can locally develop a plurality of business lines aiming at a target project, and after the development is completed, the corresponding codes are submitted to a corresponding source code storage warehouse, so that the source code storage warehouse stores target source codes corresponding to the target project.
In the embodiment of the application, when the construction condition of the target item is satisfied, the target source codes corresponding to a plurality of business lines are obtained from the target source code storage warehouse corresponding to the target item to be constructed, and the construction condition can be set according to actual requirements.
102, performing corresponding construction operation based on the target source code to obtain a construction product corresponding to the target item, wherein the construction product comprises a plurality of webpage files corresponding to the plurality of service lines respectively and public static resources corresponding to the plurality of service lines.
In the embodiment of the application, the construction operation is not limited, and can be set according to the adopted construction tool and the actual situation of the target item, and can be generally finished by a front-end construction machine. The build products are typically static resources, including web page (html) files and other static resources. HTML files herein may refer to files in hypertext markup language (Hyper Text Markup Language, HTML) format, with HTML being the file suffix. Other static resources may include, for example, css files and js files, etc. Because the target item exists in a plurality of service lines, that is, the plurality of application programs all have web pages corresponding to the same function, a plurality of same or similar static resources exist, and the static resources can be called as common static resources corresponding to the plurality of service lines. In addition, the target item has personalized difference in different service lines, the difference is mainly reflected in html files, in the embodiment of the application, different service lines need to correspond to different html files, so that setting consideration is that, on one hand, a webpage has the limitation of default titles, the default titles are solidified in the html files, different service lines generally need to realize the difference of default titles, and therefore, different html files are needed, on the other hand, different service lines can also have a small amount of static resources with different introduction requirements in a public static resource library, and different html files can introduce different static resources, so that different static resources in the public static resource library are also conveniently introduced in different service lines.
And step 103, the constructed products are classified and released to a server.
For example, after the construction operation is completed and the corresponding construction product is obtained, the construction product may be classified and then directly issued to the corresponding server; and respectively submitting the resources in the construction product storage warehouse to the corresponding server after classification is finished (such as submitting the resources through a code publisher). Wherein the build product storage warehouse may also exist in the warehouse management system. When classifying the building products, the building products can be classified into web page files and public static resources, and the building products can also be classified into public static resources, which is not limited in this embodiment.
According to the front-end project processing method, target source codes corresponding to a plurality of service lines are obtained from a target source code storage warehouse corresponding to a target project to be constructed, corresponding construction operation is carried out based on the target source codes, and a construction product corresponding to the target project is obtained, wherein the construction product comprises a plurality of webpage files corresponding to the service lines respectively and public static resources corresponding to the service lines, the construction product is classified and submitted to the corresponding product storage warehouse, and resources in the product storage warehouse are released to a server, and the server adopts a preset directory structure to store the webpage files and the public static resources separately. By adopting the technical scheme, aiming at the condition that one front-end project corresponds to the development requirements of a plurality of service lines, the corresponding target source codes can be stored in the target source code storage warehouse corresponding to the project in advance, and when the project is constructed, a plurality of webpage files respectively corresponding to the plurality of service lines and common corresponding public static resources are constructed at one time and released to the server, so that the construction flow is simplified, the construction efficiency is improved, the development cost is reduced, and the service iteration speed is accelerated.
In some embodiments, constructing a plurality of web page files corresponding to the plurality of service lines respectively based on the target source code includes: determining a target number according to the total number of the plurality of service lines; copying the webpage file templates in the target source codes for preset times to obtain initial webpage files with the target quantity, wherein the preset times are equal to the target quantity; reading the configuration information of the webpage files corresponding to the service lines in the target source code; and correspondingly configuring the initial webpage files of the target quantity according to the webpage file configuration information respectively corresponding to the plurality of service lines to obtain a plurality of webpage files respectively corresponding to the plurality of service lines. The method has the advantages that a template corresponding to the webpage file can be uniformly developed by a developer, and as the webpages of the target projects corresponding to different business lines are similar, the difference between different webpage files is small, the configuration information of the webpage file can be written only aiming at the difference part, the development cost is saved, and the development efficiency is improved. When the method is used for constructing, the webpage file template is copied for a plurality of times, and corresponding configuration is carried out according to the webpage file configuration information, so that a plurality of webpage files respectively corresponding to different service lines can be quickly and accurately constructed. Wherein, the target number is generally equal to the total number of the plurality of service lines, that is, each service line corresponds to an initial web page file. Details of the corresponding configuration of the initial web page file according to the web page file configuration information are not limited, and may include modifications such as addition, deletion, and substitution.
In some embodiments, the web page file configuration information includes replacement configuration information; the configuring the initial webpage file according to the webpage file configuration information includes: and replacing the initial content in a preset field in the initial webpage file with the corresponding target content in the replacement configuration information. The method has the advantage that personalized configuration of the webpage file can be realized rapidly by adopting a mode of directly replacing field contents. The initial content may be understood as a placeholder content, and the target content may be a real content corresponding to the current service line, for example, when the application name needs to be replaced, the initial content may be set to "APP __ reply" in a corresponding field, and the target content may be an application name actually corresponding to the current service line, such as "XXLIVE" and the like.
In some embodiments, the obtaining the target source codes corresponding to the plurality of business lines from the target source code storage warehouse corresponding to the target item to be constructed includes: acquiring item information corresponding to a target item to be constructed; judging whether a preset automatic construction condition is met according to the item information, and if so, acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to the target item. The automatic construction method has the advantages that automatic construction conditions can be preset, and when the conditions are met, the following relevant construction operation can be directly carried out, so that labor cost is saved, and timeliness of project construction is improved. The preset automatic construction conditions can be set according to actual requirements, such as considering actual use environments or stages of services.
In some embodiments, the item information includes a branch identification; the judging whether the preset automatic construction condition is met according to the project information comprises the following steps: judging whether the branch corresponding to the target item is a test environment branch or a gray level environment branch according to the branch identification, and if the branch corresponding to the target item is the test environment branch or the gray level environment branch, determining that a preset automatic construction condition is met. The method has the advantages that for the test environment, the resources finally released to the server are not actually put into use, namely, the user cannot acquire the corresponding resources, and the method belongs to the experimental stage and cannot have adverse effects on the user, so that in order to improve the test timeliness and the test efficiency, the manual operation of a tester is reduced, and the method can be set to be automatically constructed; for the gray scale environment, the resources finally released to the server are only used for gray scale experiments, namely, gray scale users participating in the gray scale experiments can acquire corresponding resources and cannot have adverse effects on a large number of users, so that manual operation of experimenters is reduced for improving the time efficiency and efficiency of the gray scale experiments, and the gray scale experiment can be set to be automatically constructed. The project information may include a project name, a branch name, etc., and the branch name may include a test environment branch, a gray environment branch, a production environment branch, etc.
In building projects, it may sometimes be necessary to use a dependency package. Taking the node project as an example, a dependent package can be understood as a package which is dependent when the online is developed and deployed, and is generally stored under a node_modules folder under the project root directory, the package version number is stored by a package. Json, and the package is installed by an npn instruction. In some embodiments, when the first construction operation is performed on the target project, the required used dependency package installation file can be downloaded from the project package management tool (Node Package Manager, NPM), and the dependency package installation file is installed, so as to obtain the dependency package required for the current construction. After the first build operation is completed, the installed dependent package and dependent package version information may be stored, which may include, for example, a version number, and the stored dependent package and dependent package version information may be referred to or used in the next build operation.
In some embodiments, before the performing the corresponding construction operation based on the target source code, the method further includes: judging whether the dependent package version in the target source code is consistent with the dependent package version when the construction operation is executed last time, if so, determining the locally installed dependent package as a target dependent package; correspondingly, the performing a corresponding construction operation based on the target source code includes: and carrying out corresponding construction operation based on the target source code and the target dependent packet. The method has the advantages that when the version of the dependent package used in the current construction operation is consistent with the version of the dependent package used in the last construction operation, the corresponding installed dependent package can be directly determined as a target dependent package, namely, the installed dependent package consistent with the version of the dependent package in the target source code is determined as the target dependent package, and the subsequent construction operation is participated.
In some embodiments, after the determining whether the dependent packet version in the target source code is consistent with the dependent packet version at the time of the last execution of the build operation, further comprising: if the dependent package version in the target source code is inconsistent with the dependent package version in the last execution of the construction operation, downloading a corresponding dependent package installation file according to the dependent package version in the target source code, and installing the dependent package installation file to obtain a target dependent package; and storing the dependent package version in the target source code and the target dependent package. The method has the advantages that if the dependent package version in the target source code is inconsistent with the dependent package version in the last construction operation execution, the dependent package required by the construction operation is changed, reinstallation is required, and the accuracy of the construction operation is ensured. For example, a new dependency package installation file consistent with the dependency package version in the target source code may be downloaded from the NPM and installed, and the installed dependency package may be applied to a subsequent build operation.
In some embodiments, after the determining whether the preset automatic construction condition is met according to the item information, the method further includes: if the preset automatic construction condition is not met, determining that the branch corresponding to the target item is a production environment branch; when the triggering of a preset construction event is detected, acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed. In general, the environment is generated outside the test environment and the gray environment, and the production environment branch can also be called a formal branch, namely a branch which needs to be formally put into use, and after the corresponding resources are released, all users can generally use the corresponding application programs and acquire the corresponding resources. For the production environment, if a problem occurs after release, the use of all users is affected, so that the production environment is not automatically constructed and needs to be triggered separately. The triggering condition of the preset building event can be set according to actual requirements, for example, the triggering condition can be manually triggered by a staff. Taking the Gitlab as an example, a construction instruction can be manually input in the Gitlab page to trigger a preset construction event.
In some embodiments, before the performing the corresponding construction operation based on the target source code, the method further includes: judging whether a dependent packet of the installed gray scale environment exists locally or not, and if the dependent packet of the installed gray scale environment does not exist locally, returning construction failure information; if the dependent package of the gray environment installed locally exists, judging whether the dependent package version in the target source code is consistent with the dependent package version of the dependent package of the gray environment when the construction operation is executed last time, if the dependent package version in the target source code is consistent with the dependent package version of the dependent package of the gray environment when the construction operation is executed last time, determining the locally installed dependent package as the target dependent package, and if the dependent package version in the target source code is inconsistent with the dependent package version of the dependent package of the gray environment when the construction operation is executed last time, returning construction failure information. The method has the advantages that for the production environment, certain conditions can be set, the situation that the construction operation becomes meaningless and unnecessary production cost is reduced because the construction operation cannot be released after the construction is completed is avoided. In the production environment, if there is no dependent package of the installed gray environment locally, it means that the dependent package version is not gray verified, but if the code without gray verification is directly issued on the line, a large range of adverse effects may be caused, so that the issuing is not allowed, and therefore, the construction operation is not performed, and the construction failure information can be returned. In addition, if there is a dependent package of the installed gray environment, but the dependent package is inconsistent with the dependent package version in the target source code, the dependent package which is required to be relied on by the current construction operation is similarly described not to carry out gray verification, and construction failure information can be returned.
In some embodiments, the common static resource includes a resource map file therein; and the construction product is classified and released to a server side, which comprises the following steps: publishing resources except the resource map file in the plurality of webpage files and the public static resources to a first service end; and publishing the resource map file in the resource map file storage warehouse to a second server. The advantage of this arrangement is that the resource map file (sourcemap) is generally used for service monitoring by the staff, and is irrelevant to the use of the user, so that it can be issued to different service ends separately from other static resources, and excessive occupation of the storage resources of the first service end is avoided. Optionally, the first service end is a content delivery network (Content Delivery Network, CDN) service end, the CDN is an intelligent virtual network built on the network basis, and by means of an edge server deployed in multiple places, a user can obtain required content nearby through load balancing, content delivery, scheduling and other functional modules of a central platform, network congestion is reduced, user access response speed and hit rate are improved, and in the embodiment of the present application, the CDN is used to store static resources related to the user, which has positive influence on page performance, that is, there is an advantage of accelerating web page display speed and the like. The second server may be a service log monitoring server, and may be set according to practical situations, for example, may be a sentry machine.
In some embodiments, the server uses a relative path to store the plurality of web page files and the common static resource separately. For example, in a CDN, a storage manner of a relative path may be used to store a plurality of web page files and a common static resource separately. The advantage of adopting the relative path is that under the condition that the domain names are the same, the relative path can enable the page to be more flexible, and when the domain names are blocked, the relative path inherits the domain names of the main domain of the page without additional processing, so that the situation that static resources cannot be used due to the blocked domain names is not needed, as long as the main domain name is available, the page can be used, the main domain name can be configured at the entrance to be replaced, and manual replacement is not needed to be developed when the domain names are blocked. Optionally, a preset directory structure is used to store the plurality of web page files and the public static resources separately, and the preset directory structure can be set according to actual requirements. The benefit of separating html files from other static resources is that: on one hand, considering rollback, if problems occur in publishing, only the html file needs to be rolled back, and as different static resources are introduced into the html file, the html file can be rolled back completely, so that the method is convenient and quick; on the other hand, due to the catalog allocation consideration, different html files are applied to different business lines, but only one common static resource is needed, so that the html files are separated from other static resources, and catalog management is facilitated.
Fig. 2 is a schematic flow chart of another front-end project processing method provided in the embodiment of the present application, fig. 3 is a schematic flow chart of a project construction process provided in the embodiment of the present application, and the embodiment of the present application may be understood with reference to fig. 3, and as shown in fig. 2, the method may include:
step 201, obtaining a branch identifier corresponding to a target item to be constructed.
For example, the needed variables may be obtained first, which may be referred to as project information, where the project information may include a branch name (i.e. a branch identifier) and a project name, and then determine whether the branch is reasonable.
Step 202, judging whether the branch corresponding to the target item is a test environment branch or a gray level environment branch according to the branch identification, if the branch corresponding to the target item is the test environment branch or the gray level environment branch, executing step 203; if the branch corresponding to the target item is not the test environment branch or the gray environment branch, step 207 is performed.
As shown in fig. 3, the branch identification includes a formal branch, a gray branch, and a test branch. If the branch mark is a gray branch or a test branch, the target item can be automatically constructed, and if the branch mark is a formal branch, the target item can be manually triggered and constructed.
Step 203, obtaining target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to the target item.
For example, if the target item can be built, the corresponding folder can be searched according to the item name, if the corresponding folder exists, the description that the target item has been built, the substitution code is pulled from the corresponding Gitlab repository (i.e., the target source code repository), if the corresponding folder does not exist, the first time the target item is built is proved, and the code needs to be copied from the target source code repository.
Step 204, judging whether the dependent package version in the target source code is consistent with the dependent package version when the construction operation is executed last time, if the dependent package version in the target source code is consistent with the dependent package version when the construction operation is executed last time, executing step 205; if the dependent package version in the target source code is inconsistent with the dependent package version at the time of the last execution of the build operation, step 206 is performed.
For example, the dependent package version in the target source code may be included in the package json file, so whether the dependent package version in the target source code is consistent with the dependent package version when the construction operation was last performed may be determined by comparing whether the package json file is the same. As shown in fig. 3, for the gray scale branch, whether the current package/json is the same as the package/json of the gray scale environment may be compared, if the current package/json is the same as the package/json of the gray scale environment, the version is the same, and if the current package/json is different from the package/json of the gray scale environment, the version is not the same. For the test branch, whether the current package is the same as the package of the test environment or not can be compared, if the current package is the same as the package of the test environment, the version is consistent, and if the current package is different from the package of the test environment, the version is inconsistent.
Step 205, determining the locally installed corresponding dependency package as a first target dependency package, and performing corresponding construction operation based on the target source code and the first target dependency package.
And 206, downloading a corresponding dependency package installation file according to the dependency package version in the target source code, installing the dependency package installation file to obtain a second target dependency package, and carrying out corresponding construction operation based on the target source code and the second target dependency package.
Step 207, determining that the branch corresponding to the target item is a production environment branch.
Step 208, determining whether a preset build event is triggered, and if the preset build event is triggered, executing step 209; if the preset build event is not triggered, step 208 is repeated.
Step 209, obtaining target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to the target item to be constructed.
Step 210, judging whether the locally-installed dependent package of the gray scale environment exists, and if the locally-installed dependent package of the gray scale environment exists, executing step 211; if there is no dependency package for the installed gray scale environment locally, step 214 is performed.
Step 211, judging whether the dependent package version in the target source code is consistent with the previous dependent package version, if so, executing step 212; if the dependent package version in the target source code is inconsistent with the previous dependent package version, step 214 is performed.
The last dependent package version refers to the dependent package version of the dependent package of the gray scale environment at the time of the last execution of the build operation.
For example, for a formal branch, that is, a production environment branch, whether a current package/json is the same as a package/json of a gray environment may be compared, if the current package/json is the same as the package/json of the gray environment, the version is the same, and if the current package/json is different from the package/json of the gray environment, the version is not the same.
And 212, determining the locally installed dependent packet of the corresponding gray environment as a third target dependent packet, and carrying out corresponding construction operation based on the target source code and the third target dependent packet.
And 213, classifying and publishing the construction products corresponding to the target items to the server.
The construction product comprises a plurality of webpage files corresponding to the service lines respectively and public static resources corresponding to the service lines.
Step 214, returning construction failure information.
According to the front-end item processing method provided by the embodiment of the application, on the basis of the optional embodiment, whether the automatic construction target item is supported is determined according to the branch identification, if the automatic construction target item is supported, the construction target item is automatically started, and if the automatic construction target item is not supported, the construction target item is required to be constructed after a preset construction event is triggered, and the starting of a construction flow is controlled more reasonably. Before the construction operation is executed, corresponding judgment is carried out on the dependent package, under the formal branch, if the dependent package of the gray environment does not exist or the dependent package in the target source code is inconsistent with the dependent package of the gray environment, the construction of the target item is not allowed, the dependent package which is not subjected to gray verification is prevented from participating in the release of the target item, under other branches, if the dependent package corresponding to the current dependent package version is successfully installed, the construction of the target item can be directly carried out, the reinstallation of the dependent package is avoided, the construction efficiency is improved, the development cost is reduced, and the service iteration speed is accelerated.
Fig. 4 is a schematic flow chart of another front-end project processing method provided in the embodiment of the present application, and fig. 5 is a schematic flow chart of a project development and construction process provided in the embodiment of the present application, where the embodiment of the present application may be understood with reference to fig. 5, and as shown in fig. 4, the method includes:
step 401, obtaining target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed.
Illustratively, as shown in FIG. 5, a developer may create a project through the fed-cli prior to development, forming a set of gitlabs in fed-activity form in the gitlab. The gitlab group includes a template repository for storing act_demo, a source code repository (the number is not limited, and only 3 items, project1, project2 and project3, are schematically listed in fig. 5), a static resource repository for storing preset type public static resources (release-assets) to be published, an html repository for storing web page files (release-pages) to be published, and a sourcemap repository for storing resource map files (release-maps) to be published. After creating the project, the developer pulls the code initialization local project from the template warehouse, and pushes (push) the source code to the corresponding source code storage warehouse (project 1 is taken as an example in the figure) after the development is completed. Then, a local development connection packaging compiling server (weback-dev-server) determines whether a gray branch (gray), a test branch (test) or a production branch (prod) is currently performed through a front-end building machine, different building triggering modes are supported according to branch types, and after the triggering building, target source codes are obtained from a source code storage warehouse.
Step 402, determining a target dependent packet according to the dependent packet version in the target source code.
The target dependency package may be a dependency package stored after the last construction, or may be a dependency package downloaded and installed again, and the determination method may refer to the related content and will not be described herein.
And 403, carrying out corresponding construction operation based on the target source code and the target dependent package to obtain a construction product corresponding to the target item.
The process of constructing a plurality of webpage files corresponding to the plurality of business lines respectively based on the target source code and the target dependent package can comprise the following steps: determining the target number according to the total number of the plurality of service lines, copying the webpage file templates in the target source codes for the preset times which are the same as the target number, reading the replacement configuration information respectively corresponding to the plurality of service lines in the target source codes, replacing the initial content in the preset field in the initial webpage file with the corresponding target content in the replacement configuration information, and obtaining a plurality of webpage files respectively corresponding to the plurality of service lines.
For example, when the parameter (i.e., the preset field) is AAA, the text that needs to be replaced (i.e., the initial content) may be denoted as AAA __ reply, and double underlining may be used therebetween, avoiding duplication with other text.
For example, the replacement configuration information may include the following:
if the above configuration information is read, an alternative way may be:
replacing a TITLE __ REPLACEMENT text in html under the alive folder with 'BLIVE'; replacing the TITLE __ REPLACEMENT text in html under the LLIVE folder with 'LLIVE'; replacing APP __ REPLACEMENT text in html under the alive folder with 'alive'; the APP __ REPLACEMENT text in html under the llive folder is replaced with 'llive'.
And 404, dividing the construction product into a plurality of webpage files, resource map files and preset type public static resources which correspond to the service lines respectively.
The resource map file and the preset type of public static resource together form a public static resource. As shown in FIG. 5, the build products are divided into html, sourcemap and packages.
Step 405, submitting the web page file to a corresponding web page storage warehouse, submitting the resource map file to a corresponding resource map storage warehouse, and submitting the public static resources of the preset type to a corresponding static resource storage warehouse.
As shown in FIG. 5, html is submitted to an html store, sourcemap is submitted to a sourcemap store, and assets is submitted to an assets store.
And step 406, publishing the resources in the webpage storage warehouse to the content distribution network server, publishing the resources in the resource map storage warehouse to the business log monitoring server, and publishing the resources in the static resource storage warehouse to the content distribution network server.
As shown in FIG. 5, the resources in the html store are synchronized (rsync) to the CDN source, the resources in the sourcemap store to the send machine, and the resources in the assets store to the CDN source.
Optionally, the time of the target item on line in different service lines may be different, so as to ensure that other service lines are not affected when a code of one service line is issued, service line names may be filled in when the code is constructed, and when the code needs to be modified, only html files corresponding to the filled service line names are modified, so that other service lines which do not need to be modified are not affected.
For example, in a CDN source, a preset directory structure may be used to store web page files and preset types of public static resources separately using relative paths.
Illustratively, a schematic illustration of a directory structure is provided below:
root directory
--as
----assets
------project1
--------css
----------style.css
--------js
----------js.js
------project2
----libs
------lib1
--------v1.1.0
--------v1.1.1
------lib2
--pages
----project1
------app1
--------index.html
------app2
----project2
The above directory structure is explained as follows:
as: as asia abbreviation, is a rule requirement for picture scaling conversion; the processes: storing the files in css format, js format and the like; project1: item names; libs: a catalog of common libraries, which may require the introduction of multiple items, may be placed outside, while for ease of maintenance, version control may be performed, such as v1.1.0 and v1.1.1 below. pages: storing html format files; app1: service line name.
According to the front-end project processing method, a set of codes are used by a plurality of service lines, development cost is reduced, service iteration speed is increased, a developer only needs to develop a set of codes, a plurality of html files are finally constructed for different service lines to use, different resources can be introduced into different service lines through a text replacement mode, so that differentiated processing of different service lines is achieved, source codes of different projects are stored in different warehouses, warehouse volume is reduced, therefore, the code pulling speed is increased, a dependent package is saved, the dependent package does not need to be downloaded again when the dependent package version is unchanged, meanwhile, due to the fact that the dependent package of a gray scale environment is used in a production environment, the production environment does not need to be provided with the dependent package, packaging is quicker, in addition, due to the fact that the introduced static resources are all relative paths, the fact that the static resources due to a forbidden domain name cannot be used is not concerned, the fact that the domain name of a main domain is available is not needed, and the page can be used.
Fig. 6 is a block diagram of a front-end processing device according to an embodiment of the present application, where the device may be implemented by software and/or hardware, and may be generally integrated in a computer device, and the front-end processing may be performed by executing a front-end processing method. As shown in fig. 6, the apparatus includes:
the target source code acquisition module 601 is configured to acquire target source codes corresponding to a plurality of service lines from a target source code storage warehouse corresponding to a target item to be constructed; the project construction module 602 is configured to perform a corresponding construction operation based on the target source code to obtain a construction product corresponding to the target project, where the construction product includes a plurality of web page files corresponding to the plurality of service lines respectively and a public static resource corresponding to the plurality of service lines; the build product release module 603 is configured to release the build product classification to a server.
According to the front-end project processing device provided by the embodiment of the application, target source codes corresponding to a plurality of business lines are obtained from the target source code storage warehouse corresponding to a target project to be constructed, corresponding construction operation is carried out based on the target source codes, and a construction product corresponding to the target project is obtained, wherein the construction product comprises a plurality of webpage files corresponding to the business lines respectively and public static resources corresponding to the business lines, the construction product is classified and submitted to the corresponding product storage warehouse, and the resources in the product storage warehouse are released to the server, and the server adopts a preset directory structure to store the webpage files and the public static resources separately. By adopting the technical scheme, aiming at the condition that one front-end project corresponds to the development requirements of a plurality of service lines, the corresponding target source codes can be stored in the target source code storage warehouse corresponding to the project in advance, and when the project is constructed, a plurality of webpage files respectively corresponding to the plurality of service lines and common corresponding public static resources are constructed at one time and released to the server, so that the construction flow is simplified, the construction efficiency is improved, the development cost is reduced, and the service iteration speed is accelerated.
The embodiment of the application provides a computer device, and the front-end item processing device provided by the embodiment of the application can be integrated in the computer device. Fig. 7 is a block diagram of a computer device according to an embodiment of the present application. The computer device 700 comprises a memory 701, a processor 702 and a computer program stored in the memory 701 and executable on the processor 702, wherein the processor 702 implements the front-end item processing method provided by the embodiments of the present application when executing the computer program.
The embodiment of the application provides a project management system, which comprises computer equipment, a warehouse management system and a server, wherein the warehouse management system is set to manage a target source code storage warehouse, and the server is set to store a construction product received by a server.
The present embodiments also provide a storage medium containing computer executable instructions, which when executed by a computer processor, are for performing the front-end item processing method provided by the embodiments of the present application. Wherein the storage medium may be a non-transitory storage medium.
The front-end item processing device, the device and the storage medium provided in the foregoing embodiments may execute the front-end item processing method provided in any embodiment of the present application, and have functional modules and effects corresponding to executing the method. Technical details not described in detail in the above embodiments may be referred to the front-end item processing method provided in any embodiment of the present application.

Claims (15)

  1. A front-end project processing method, comprising:
    acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed;
    performing construction operation based on the target source code to obtain a construction product corresponding to the target item, wherein the construction product comprises a plurality of webpage files corresponding to the service lines respectively and public static resources corresponding to the service lines;
    and the construction products are classified and released to a server.
  2. The method of claim 1, wherein performing the constructing operation based on the target source code to obtain a plurality of web page files corresponding to the plurality of service lines respectively, comprises:
    determining a target number according to the total number of the plurality of service lines;
    copying the webpage file templates in the target source codes for preset times to obtain initial webpage files with the target quantity, wherein the preset times are equal to the target quantity;
    reading the configuration information of the webpage files corresponding to the service lines in the target source code;
    and configuring the initial webpage files of the target quantity according to the webpage file configuration information respectively corresponding to the plurality of service lines to obtain a plurality of webpage files respectively corresponding to the plurality of service lines.
  3. The method of claim 2, wherein the web page file configuration information includes replacement configuration information;
    the configuring the initial webpage files of the target number according to the webpage file configuration information respectively corresponding to the plurality of service lines includes:
    and replacing the initial content in a preset field in the initial webpage file with the target content in the replacement configuration information corresponding to the initial webpage file.
  4. The method of claim 1, wherein the obtaining the target source codes of the corresponding plurality of business lines from the target source code repository corresponding to the target item to be constructed comprises:
    acquiring item information corresponding to the target item to be constructed;
    judging whether a preset automatic construction condition is met according to the item information, and acquiring target source codes corresponding to the plurality of business lines from a target source code storage warehouse corresponding to the target item to be constructed in response to the preset automatic construction condition.
  5. The method of claim 4, wherein the item information includes a branch identification;
    the judging whether the preset automatic construction condition is met according to the project information comprises the following steps:
    Judging whether the branch corresponding to the target item to be constructed is a test environment branch or a gray scale environment branch according to the branch identification, and determining that the preset automatic construction condition is met in response to the branch corresponding to the target item to be constructed being the test environment branch or the gray scale environment branch.
  6. The method of claim 5, further comprising, prior to the constructing operation based on the target source code:
    judging whether the dependent package version in the target source code is consistent with the dependent package version under the condition of the last execution of the construction operation, and determining the locally installed dependent package as a target dependent package in response to the fact that the dependent package version in the target source code is consistent with the dependent package version under the condition of the last execution of the construction operation;
    the constructing operation based on the target source code comprises the following steps:
    and performing construction operation based on the target source code and the target dependent package.
  7. The method of claim 6, after said determining whether the dependent packet version in the target source code is consistent with the dependent packet version in the case of the last execution of the build operation, further comprising:
    responding to the inconsistency between the dependent package version in the target source code and the dependent package version under the condition of the last execution of the construction operation, downloading a dependent package installation file according to the dependent package version in the target source code, and installing the dependent package installation file to obtain the target dependent package;
    And storing the dependent package version in the target source code and the target dependent package.
  8. The method of claim 4, further comprising, after said determining whether a preset automatic construction condition is satisfied according to said item information:
    determining that the branch corresponding to the target item is a production environment branch in response to the preset automatic construction condition not being met;
    and under the condition that the triggering of a preset construction event is detected, acquiring target source codes corresponding to the plurality of business lines from a target source code storage warehouse corresponding to the target item to be constructed.
  9. The method of claim 8, further comprising, prior to the constructing operation based on the target source code:
    judging whether a dependent packet of the installed gray scale environment exists locally or not, and returning construction failure information in response to the fact that the dependent packet of the installed gray scale environment does not exist locally; and judging whether the dependent packet version in the target source code is consistent with the dependent packet version of the dependent packet of the gray scale environment in the case of the last execution of the construction operation or not in response to the locally existing dependent packet of the gray scale environment, determining the locally installed dependent packet as the target dependent packet in response to the dependent packet version in the target source code being consistent with the dependent packet version of the dependent packet of the gray scale environment in the case of the last execution of the construction operation, and returning construction failure information in response to the dependent packet version in the target source code being inconsistent with the dependent packet version of the dependent packet of the gray scale environment in the case of the last execution of the construction operation.
  10. The method of claim 1, wherein the common static resource comprises a resource map file therein;
    the step of classifying and publishing the construction products to a server side comprises the following steps:
    publishing the resources except the resource map file in the plurality of webpage files and the public static resources to a content distribution network server;
    and publishing the resource map file in the resource map file storage warehouse to a business log monitoring server.
  11. The method of claim 1, wherein the server uses a relative path to store the plurality of web page files and the common static resource separately.
  12. A front-end item processing apparatus comprising:
    the target source code acquisition module is used for acquiring target source codes corresponding to a plurality of business lines from a target source code storage warehouse corresponding to a target item to be constructed;
    the project construction module is configured to perform construction operation based on the target source code to obtain a construction product corresponding to the target project, wherein the construction product comprises a plurality of webpage files corresponding to the plurality of service lines respectively and public static resources corresponding to the plurality of service lines;
    and the construction product issuing module is used for issuing the construction products in a classified manner to the server.
  13. 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 front-end item processing method of any of claims 1-11 when the computer program is executed.
  14. A project management system comprising a computer device as claimed in claim 13, a warehouse management system arranged to manage a target source deposit warehouse, and a server arranged to store build products received by a server.
  15. A computer readable storage medium storing a computer program, wherein the program when executed by a processor implements the front-end item processing method according to any one of claims 1-11.
CN202180075173.8A 2020-12-10 2021-12-09 Front-end item processing method, device, equipment, management system and storage medium Pending CN117693734A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011457915 2020-12-10
PCT/CN2021/136647 WO2022121971A1 (en) 2020-12-10 2021-12-09 Front-end project processing method and apparatus, device, management system, and storage medium

Publications (1)

Publication Number Publication Date
CN117693734A true CN117693734A (en) 2024-03-12

Family

ID=81974244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180075173.8A Pending CN117693734A (en) 2020-12-10 2021-12-09 Front-end item processing method, device, equipment, management system and storage medium

Country Status (2)

Country Link
CN (1) CN117693734A (en)
WO (1) WO2022121971A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069325B (en) * 2023-01-28 2023-08-04 深圳市明源云采购科技有限公司 Front-end project construction method, device, equipment and computer readable storage medium
CN116627419A (en) * 2023-07-24 2023-08-22 中国电信股份有限公司 Front-end service packaging method and related equipment
CN117421039B (en) * 2023-12-18 2024-02-27 北京中诺链捷数字科技有限公司 Version information generation method, device and equipment of front-end Vue engineering and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9043765B2 (en) * 2011-11-09 2015-05-26 Microsoft Technology Licensing, Llc Simultaneously targeting multiple homogeneous and heterogeneous runtime environments
CN111352649B (en) * 2018-12-24 2023-09-22 北京嘀嘀无限科技发展有限公司 Code processing method, device, server and readable storage medium
CN109634647B (en) * 2018-12-25 2022-02-01 思必驰科技股份有限公司 Construction method and system of large-scale front-end project
CN111813379A (en) * 2019-04-11 2020-10-23 阿里巴巴集团控股有限公司 Application deployment method and device, electronic equipment and computer readable storage medium
CN110413272B (en) * 2019-07-30 2023-10-13 广州市百果园信息技术有限公司 Front-end project construction method, device, storage medium and equipment
CN111273898B (en) * 2020-02-25 2024-03-19 安徽以萨数据技术有限公司 Automatic construction method, system and storage medium for web front-end code

Also Published As

Publication number Publication date
WO2022121971A1 (en) 2022-06-16

Similar Documents

Publication Publication Date Title
CN109885311B (en) Application program generation method and device
US10176217B1 (en) Dynamically performing data processing in a data pipeline system
CN107317724B (en) Data acquisition system and method based on cloud computing technology
US8302093B2 (en) Automated deployment of defined topology in distributed computing environment
CN117693734A (en) Front-end item processing method, device, equipment, management system and storage medium
US8321856B2 (en) Supplying software updates synchronously
US11561784B2 (en) Versioning of pipeline templates for continuous delivery of services on datacenters configured in cloud platforms
US7886035B2 (en) Profile service based deployment configuration
US8327341B2 (en) Integrating aspect oriented programming into the application server
US10169005B2 (en) Consolidating and reusing portal information
US8640121B2 (en) Facilitating multi-installer product installations
US20200387387A1 (en) System for building, managing, deploying and executing reusable analytical solution modules for industry applications
CN111580926A (en) Model publishing method, model deploying method, model publishing device, model deploying device, model publishing equipment and storage medium
US11392366B1 (en) Optimized compilation of pipelines for continuous delivery of services on datacenters configured in cloud platforms
US11714747B2 (en) Executing integration scenario regression tests in customer landscapes
US11144292B2 (en) Packaging support system and packaging support method
US9904574B2 (en) Parallel computing without requiring antecedent code deployment
CN112685105A (en) Front-end component sharing method and device, computer equipment and storage medium
CN111078637A (en) Script file online method and device, computer equipment and storage medium
CN107391528B (en) Front-end component dependent information searching method and equipment
US20200097260A1 (en) Software application developer tools platform
CN116301951B (en) Micro-service application installation upgrading method and device based on kubernetes
CN112631563A (en) System development method and device based on framework, computer equipment and storage medium
CN111679828A (en) Data processing method and device, electronic equipment and storage medium
CN109582347B (en) Method and device for acquiring front-end codes

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