CN110347385A - A kind of method and system that distribution Web static resource is shared - Google Patents

A kind of method and system that distribution Web static resource is shared Download PDF

Info

Publication number
CN110347385A
CN110347385A CN201910653166.6A CN201910653166A CN110347385A CN 110347385 A CN110347385 A CN 110347385A CN 201910653166 A CN201910653166 A CN 201910653166A CN 110347385 A CN110347385 A CN 110347385A
Authority
CN
China
Prior art keywords
static resource
packet
file
file packet
npm
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
CN201910653166.6A
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN201910653166.6A priority Critical patent/CN110347385A/en
Publication of CN110347385A publication Critical patent/CN110347385A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses the method and system that a kind of distribution Web static resource is shared, and belong to front-end technology field.The shared method of distribution Web static resource of the invention is the following steps are included: S1, creation static resource file packet and upload to the privately owned warehouse npm;S2, each subsystem addition static resource file packet rely on, and static resource file packet are downloaded to project;S3, the static file in static resource file packet is copied in the static resource catalogue of system item itself;S4, deployment and running subsystem project.The shared method of the distribution Web static resource of the invention can make developer only be absorbed in the exploitation of oneself module, to promote development efficiency, while greatly reducing and safeguarding inconsistent problem, have good application value.

Description

A kind of method and system that distribution Web static resource is shared
Technical field
The present invention relates to front-end technology fields, specifically provide a kind of method and system that distribution Web static resource is shared.
Background technique
Recently as big data, the development of cloud computing, cloud platform is also more and more, function complexity and sweeping system Website is also more and more.These system websites can be divided by function as multiple subsystems, and subsystems can be single Only development deployment, but have some common static resources, such as public css file, picture, logo in these subsystems again Deng.Web application traditional at present is all unified plan, and static resource does not need individually to safeguard yet, safeguards together with project. But the cloud platform service that includes and product is many kinds of, developer is numerous.Therefore, the exploitation of cloud platform can be according to Product is divided into multiple subsystems, and subsystem independent can be developed, safeguard, dispose, so that developer be made to be absorbed in exploitation Development progress of the one's own module without being concerned about others.
Due to independent exploitation, maintenance, the deployment of subsystems, lead to the common static money of some whole systems When source changes, subsystems require the operation for changing file or executing some additions and deletions pictures etc., very numerous It is trivial, and easy error leads to some logo or pattern disunity of whole system.In addition, the web system of distributed deployment is all Be it is independent, be not associated with from each other, but whole system is unified, some static resources such as css pattern file, Picture logo file etc. is consistent.But if these general static resource files are placed individually into subsystems On, it is particularly troublesome that maintenance, which is got up, and easilys lead to inconsistent problem.
Summary of the invention
Technical assignment of the invention is that in view of the above problems, providing one kind can be such that developer is only absorbed in certainly The exploitation of own module to promote development efficiency, while greatly reducing the distribution Web static resource for safeguarding inconsistent problem Shared method.
The further technical assignment of the present invention is to provide a kind of method that distribution Web static resource is shared.
To achieve the above object, the present invention provides the following technical scheme that
A kind of method that distribution Web static resource is shared, method includes the following steps:
S1, creation static resource file packet simultaneously upload to the privately owned warehouse npm;
S2, each subsystem addition static resource file packet rely on, and static resource file packet are downloaded to project;
S3, the static file in static resource file packet is copied in the static resource catalogue of system item itself;
S4, deployment and running subsystem project.
It can unify maintenance static resource file by the method that the distribution Web static resource is shared, avoid each The developer of subsystem goes the cumbersome work safeguarded respectively, and the developer of each module can be made only to be absorbed in oneself module Exploitation, to promote development efficiency, while also installation reduces the appearance for safeguarding inconsistence problems significantly.
Preferably, create individual item file in step S1, static resource is stored in item file, and File packet package.json is created under the root of the item file, file packet package.json includes packet name, the version of packet This number.
Preferably, installing npm packet management tool in step S1, the privately owned warehouse npm is built, creates static resource file It wraps and is uploaded to the privately owned warehouse npm built.
Preferably, being wrapped and being passed in the warehouse npm built by static resource file using npm order in step S1, send out When raw change, the version number in file packet package.json is modified, is uploaded again.
Preferably, describing the dependence configuration in file package.json under the root of each subsystem in step S2 Item runs npm install and npm update plus the dependence to static resource file packet before deployment, will rely on preservation The latest edition of static resource file packet downloads in project.
Preferably, running copy script, copy script traverses static resource file packet, and static state is provided in step S3 The All Files of source file packet copy under the static resource catalogue of subsystem item itself.
A kind of system that distribution Web static resource is shared, including static resource file packet creation module, static resource text Part packet download module and subsystem item run module:
Static resource file packet creation module is for creating static resource file packet and uploading to the privately owned warehouse npm;
Static resource file packet download module is used to rely in each subsystem addition static resource file packet, and static state is provided Source file packet downloads to project;
Subsystem item operation module is used to the static file in static resource file packet copying to system item itself Static resource catalogue in, dispose and running subsystem project.
Preferably, installing npm packet management tool in the static resource file packet creation module, the privately owned storehouse npm is built Library creates static resource file packet and is uploaded to the privately owned warehouse npm built, individual item file created, by static resource It is stored in item file, and creates file packet package.json, file packet under the root of the item file Package.json includes the version number of packet name, packet.
Preferably, describing file under the root of each subsystem in static resource file packet download module Configuration item is relied on plus the dependence to static resource file packet in package.json, and npm install is run before deployment And npm update, the latest edition for relying on the static resource file packet saved is downloaded in project.
Preferably, the subsystem item operation module runs copy script, copy script traverses static resource file Packet, and the All Files of static resource file packet are copied under the static resource catalogue of subsystem item itself.
Compared with prior art, the shared method of distribution Web static resource of the invention has following prominent beneficial Effect: the shared method of the distribution Web static resource reaches each by providing a public static resource file packet Subsystem shares the effect of public static resource, and the developer of each system module can be made not have to be concerned about and safeguard Public resource, public resource packet can have special messenger's maintenance, while the development efficiency of developer can be improved.And due to public The unified maintenance and update of resource packet, have ensured the unification between the subsystems of distributed deployment web, have had good push away Wide application value.
Detailed description of the invention
Fig. 1 is the flow chart of the shared method of distribution Web static resource of the present invention.
Specific embodiment
Below in conjunction with drawings and examples, the method and system that distribution Web static resource of the invention is shared are made It is further described.
Embodiment
As shown in Figure 1, the method that distribution Web static resource of the invention is shared, comprising the following steps:
S1, creation static resource file packet simultaneously upload to the privately owned warehouse npm.
Npm packet management tool is installed, the privately owned warehouse npm is built, create static resource file packet and is uploaded to the private built There is the warehouse npm.
Individual item file is created, static resource is stored in item file, and in the root of the item file Lower creation file packet package.json, file packet package.json include the version number of packet name, packet.
Static resource file is wrapped using npm order and is passed in the warehouse npm built, when changing, modifies file The version number in package.json is wrapped, is uploaded again.
S2, each subsystem addition static resource file packet rely on, and static resource file packet are downloaded to project.
The dependence configuration item in file package.json is described under the root of each subsystem to add to static resource text The dependence of part packet runs npm install and npm update before deployment, will rely on the static resource file packet of preservation most New version downloads in project.
S3, the static file in static resource file packet is copied in the static resource catalogue of system item itself.
Copy script is run, copy script traverses static resource file packet, and by the All Files of static resource file packet It copies under the static resource catalogue of subsystem item itself.
S4, deployment and running subsystem project.
The shared system of distribution Web static resource of the present invention, including static resource file packet creation module, static resource File packet download module and subsystem item run module.
Static resource file packet creation module is for creating static resource file packet and uploading to the privately owned warehouse npm.
Npm packet management tool is installed, the privately owned warehouse npm is built, create static resource file packet and is uploaded to the private built There is the warehouse npm.
Individual item file is created, static resource is stored in item file, and in the root of the item file Lower creation file packet package.json, file packet package.json include the version number of packet name, packet.
Static resource file is wrapped using npm order and is passed in the warehouse npm built, when changing, modifies file The version number in package.json is wrapped, is uploaded again.
Static resource file packet download module is used to rely in each subsystem addition static resource file packet, and static state is provided Source file packet downloads to project.
In static resource file packet download module, described under the root of each subsystem in file package.json according to Rely configuration item plus the dependence to static resource file packet, npm install and npm update is run before deployment, will be relied on The latest edition of the static resource file packet of preservation downloads in project.
Subsystem item operation module is used to the static file in static resource file packet copying to system item itself Static resource catalogue in, dispose and running subsystem project.
Subsystem item runs module and runs copy script, and copy script traverses static resource file packet, and static state is provided The All Files of source file packet copy under the static resource catalogue of subsystem item itself.
Embodiment described above, the only present invention more preferably specific embodiment, those skilled in the art is at this The usual variations and alternatives carried out within the scope of inventive technique scheme should be all included within the scope of the present invention.

Claims (10)

1. a kind of shared method of distribution Web static resource, it is characterised in that: method includes the following steps:
S1, creation static resource file packet simultaneously upload to the privately owned warehouse npm;
S2, each subsystem addition static resource file packet rely on, and static resource file packet are downloaded to project;
S3, the static file in static resource file packet is copied in the static resource catalogue of system item itself;
S4, deployment and running subsystem project.
2. the shared method of distribution Web static resource according to claim 1, it is characterised in that: in step S1, creation Individual item file, static resource is stored in item file, and file packet is created under the root of the item file Package.json, file packet package.json include the version number of packet name, packet.
3. the shared method of distribution Web static resource according to claim 2, it is characterised in that: in step S1, installation Npm packet management tool builds the privately owned warehouse npm, creates static resource file packet and is uploaded to the privately owned warehouse npm built.
4. the shared method of distribution Web static resource according to claim 3, it is characterised in that: in step S1, use Static resource file is wrapped and is passed in the warehouse npm built by npm order, when changing, modifies file packet Version number in package.json, uploads again.
5. the shared method of distribution Web static resource according to claim 4, it is characterised in that: in step S2, each son It describes to rely on configuration item plus dependence to static resource file packet in file package.json under the root of system, Npm install and npm update is run before deployment, and the latest edition for relying on the static resource file packet saved is downloaded to In project.
6. the shared method of distribution Web static resource according to claim 5, it is characterised in that: in step S3, operation Copy script, copy script traverses static resource file packet, and the All Files of static resource file packet are copied to subsystem Under the static resource catalogue of project itself.
7. a kind of shared system of distribution Web static resource, it is characterised in that: including static resource file packet creation module, Static resource file packet download module and subsystem item run module:
Static resource file packet creation module is for creating static resource file packet and uploading to the privately owned warehouse npm;
Static resource file packet download module is used to rely in each subsystem addition static resource file packet, and static resource is literary Part packet downloads to project;
Subsystem item operation module is used to the static file in static resource file packet copying to the quiet of system item itself In state Resource TOC, simultaneously running subsystem project is disposed.
8. the shared system of distribution Web static resource according to claim 7, it is characterised in that: the static resource Npm packet management tool is installed in file packet creation module, builds the privately owned warehouse npm, create static resource file packet and is uploaded to The privately owned warehouse npm built, creates individual item file, static resource is stored in item file, and in project text File packet package.json is created under the root of part, file packet package.json includes the version number of packet name, packet.
9. the shared system of distribution Web static resource according to claim 8, it is characterised in that: static resource file In packet download module, the dependence configuration item in file package.json is described under the root of each subsystem and is added to static state money The dependence of source file packet runs npm install and npm update before deployment, will rely on the static resource file packet saved Latest edition download in project.
10. the shared system of distribution Web static resource according to claim 9, it is characterised in that: the subsystem item Mesh runs module and runs copy script, and copy script traverses static resource file packet, and by all texts of static resource file packet Part copies under the static resource catalogue of subsystem item itself.
CN201910653166.6A 2019-07-19 2019-07-19 A kind of method and system that distribution Web static resource is shared Pending CN110347385A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910653166.6A CN110347385A (en) 2019-07-19 2019-07-19 A kind of method and system that distribution Web static resource is shared

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910653166.6A CN110347385A (en) 2019-07-19 2019-07-19 A kind of method and system that distribution Web static resource is shared

Publications (1)

Publication Number Publication Date
CN110347385A true CN110347385A (en) 2019-10-18

Family

ID=68179347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910653166.6A Pending CN110347385A (en) 2019-07-19 2019-07-19 A kind of method and system that distribution Web static resource is shared

Country Status (1)

Country Link
CN (1) CN110347385A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment
CN112035160A (en) * 2020-08-31 2020-12-04 广州鲁邦通物联网科技有限公司 Code management system and control method thereof
CN112199080A (en) * 2020-09-28 2021-01-08 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN113656048A (en) * 2021-08-25 2021-11-16 工银科技有限公司 Business component code installation method, tool and component code sharing system
CN114363322A (en) * 2022-01-05 2022-04-15 北京爱学习博乐教育科技有限公司 CDN uploading system for static resources
CN115129333A (en) * 2022-09-02 2022-09-30 城云科技(中国)有限公司 Npm resource packet management method, device and system suitable for micro front-end framework

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978194A (en) * 2015-06-25 2015-10-14 北京京东尚科信息技术有限公司 Web page front-end development method and apparatus
CN106777299A (en) * 2016-12-30 2017-05-31 深圳市彬讯科技有限公司 The project dependence solution of operation management instrument and static data warehouse
US20180081661A1 (en) * 2016-09-16 2018-03-22 Microsoft Technology Licensing, Llc Optimization for Multi-Project Package Manager
CN108536431A (en) * 2018-04-04 2018-09-14 浙江小泰科技有限公司 A kind of global command's row creates front end project approach and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978194A (en) * 2015-06-25 2015-10-14 北京京东尚科信息技术有限公司 Web page front-end development method and apparatus
US20180081661A1 (en) * 2016-09-16 2018-03-22 Microsoft Technology Licensing, Llc Optimization for Multi-Project Package Manager
CN106777299A (en) * 2016-12-30 2017-05-31 深圳市彬讯科技有限公司 The project dependence solution of operation management instrument and static data warehouse
CN108536431A (en) * 2018-04-04 2018-09-14 浙江小泰科技有限公司 A kind of global command's row creates front end project approach and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment
CN112035160A (en) * 2020-08-31 2020-12-04 广州鲁邦通物联网科技有限公司 Code management system and control method thereof
CN112199080A (en) * 2020-09-28 2021-01-08 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN112199080B (en) * 2020-09-28 2023-02-17 上海上讯信息技术股份有限公司 Webpack construction method and equipment for vuejs project
CN113656048A (en) * 2021-08-25 2021-11-16 工银科技有限公司 Business component code installation method, tool and component code sharing system
CN114363322A (en) * 2022-01-05 2022-04-15 北京爱学习博乐教育科技有限公司 CDN uploading system for static resources
CN115129333A (en) * 2022-09-02 2022-09-30 城云科技(中国)有限公司 Npm resource packet management method, device and system suitable for micro front-end framework

Similar Documents

Publication Publication Date Title
CN110347385A (en) A kind of method and system that distribution Web static resource is shared
US10318287B2 (en) Deploying documents to a server in a specific environment
CN109885316B (en) Hdfs-hbase deployment method and device based on kubernetes
CN102349062B (en) Method and system for synchronizing browser caches across devices and web services
US9823915B1 (en) Software container format
US20160048408A1 (en) Replication of virtualized infrastructure within distributed computing environments
McLay et al. Best practices for the deployment and management of production HPC clusters
CN103473287A (en) Method and system for automatically distributing, running and updating executable programs
US20130283259A1 (en) Application installation
CN101288048A (en) Content syndication platform
JP5371095B2 (en) Patch application system
CN103729195A (en) Control method and system for software version
CN104301338A (en) Cloud platform based automatic deploying method for application system
CN113938321B (en) Extensible operation and maintenance management system, method, electronic equipment and readable storage medium
US10466991B1 (en) Computing instance software package installation
US8458693B2 (en) Transitioning from static to dynamic cluster management
CN102638566A (en) BLOG system running method based on cloud storage
CN112947992B (en) Code version management method and device
CN113220283A (en) Internet of things APP development system based on cloud arrangement
CN108804241A (en) Cross-platform method for scheduling task, system, computer equipment and storage medium
CN109343858A (en) A kind of build a station automatically container deployment system and its working method based on server-side rendering
KR20140113685A (en) Installation engine and package format for parallelizable, reliable installations
CN112486938A (en) Log collection method and system applied to kubernets cluster
CN113238731B (en) Ebed development platform
CN103838609A (en) Method and system for automatically monitoring software updating

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191018