JenkinsX构建前端解决npm依赖包慢的问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JenkinsX构建前端解决npm依赖包慢的问题相关的知识,希望对你有一定的参考价值。

参考技术A

使用的是基于k8s环境的JenkinsX,JenkinsX是Jenkins在云环境的版本,支持k8s构建环境,就是通过启用各类构建工具的pod,比如node的pod,maven的pod。

由于使用不熟练,遇到一些问题,总结下来供以后参考:

经过多次实践,解决方案如下:
第一种方案:简单直接,使用淘宝的npm镜像 。这样其实速度能快很多

第二种方案:缓存npm包,挂载k8s的pv到pod
1.1 把pv挂载node环境的pod容器的/node_modules下
1.2 进入项目目录,这里的项目目录为test,建立软连接:

其实这种方案也解决了容器耗费节点临时资源太多被驱逐的问题,因为使用的存储卷。
仅做记录,供以后参考。

Python 技术篇 - python镜像推荐,实现python最新官方安装包飞速下载,解决www.python.org官网无法访问下载安装包慢问题

镜像地址:http://npm.taobao.org/mirrors/python/

这是我爬取的各版本连接清单如下:

http://npm.taobao.org/mirrors/python/2.0.1/
http://npm.taobao.org/mirrors/python/2.0/
http://npm.taobao.org/mirrors/python/2.1.1/
http://npm.taobao.org/mirrors/python/2.1.2/
http://npm.taobao.org/mirrors/python/2.1.3/
http://npm.taobao.org/mirrors/python/2.1/
http://npm.taobao.org/mirrors/python/2.2.1/
http://npm.taobao.org/mirrors/python/2.2.2/
http://npm.taobao.org/mirrors/python/2.2.3/
http://npm.taobao.org/mirrors/python/2.2/
http://npm.taobao.org/mirrors/python/2.3.1/
http://npm.taobao.org/mirrors/python/2.3.2/
http://npm.taobao.org/mirrors/python/2.3.3/
http://npm.taobao.org/mirrors/python/2.3.4/
http://npm.taobao.org/mirrors/python/2.3.5/
http://npm.taobao.org/mirrors/python/2.3.6/
http://npm.taobao.org/mirrors/python/2.3.7/
http://npm.taobao.org/mirrors/python/2.3/
http://npm.taobao.org/mirrors/python/2.4.1/
http://npm.taobao.org/mirrors/python/2.4.2/
http://npm.taobao.org/mirrors/python/2.4.3/
http://npm.taobao.org/mirrors/python/2.4.4/
http://npm.taobao.org/mirrors/python/2.4.5/
http://npm.taobao.org/mirrors/python/2.4.6/
http://npm.taobao.org/mirrors/python/2.4/
http://npm.taobao.org/mirrors/python/2.5.1/
http://npm.taobao.org/mirrors/python/2.5.2/
http://npm.taobao.org/mirrors/python/2.5.3/
http://npm.taobao.org/mirrors/python/2.5.4/
http://npm.taobao.org/mirrors/python/2.5.5/
http://npm.taobao.org/mirrors/python/2.5.6/
http://npm.taobao.org/mirrors/python/2.5/
http://npm.taobao.org/mirrors/python/2.6.1/
http://npm.taobao.org/mirrors/python/2.6.2/
http://npm.taobao.org/mirrors/python/2.6.3/
http://npm.taobao.org/mirrors/python/2.6.4/
http://npm.taobao.org/mirrors/python/2.6.5/
http://npm.taobao.org/mirrors/python/2.6.6/
http://npm.taobao.org/mirrors/python/2.6.7/
http://npm.taobao.org/mirrors/python/2.6.8/
http://npm.taobao.org/mirrors/python/2.6.9/
http://npm.taobao.org/mirrors/python/2.6/
http://npm.taobao.org/mirrors/python/2.7.1/
http://npm.taobao.org/mirrors/python/2.7.10/
http://npm.taobao.org/mirrors/python/2.7.11/
http://npm.taobao.org/mirrors/python/2.7.12/
http://npm.taobao.org/mirrors/python/2.7.13/
http://npm.taobao.org/mirrors/python/2.7.14/
http://npm.taobao.org/mirrors/python/2.7.15/
http://npm.taobao.org/mirrors/python/2.7.16/
http://npm.taobao.org/mirrors/python/2.7.17/
http://npm.taobao.org/mirrors/python/2.7.18/
http://npm.taobao.org/mirrors/python/2.7.2/
http://npm.taobao.org/mirrors/python/2.7.3/
http://npm.taobao.org/mirrors/python/2.7.4/
http://npm.taobao.org/mirrors/python/2.7.5/
http://npm.taobao.org/mirrors/python/2.7.6/
http://npm.taobao.org/mirrors/python/2.7.7/
http://npm.taobao.org/mirrors/python/2.7.8/
http://npm.taobao.org/mirrors/python/2.7.9/
http://npm.taobao.org/mirrors/python/2.7/
http://npm.taobao.org/mirrors/python/3.0.1/
http://npm.taobao.org/mirrors/python/3.0/
http://npm.taobao.org/mirrors/python/3.1.1/
http://npm.taobao.org/mirrors/python/3.1.2/
http://npm.taobao.org/mirrors/python/3.1.3/
http://npm.taobao.org/mirrors/python/3.1.4/
http://npm.taobao.org/mirrors/python/3.1.5/
http://npm.taobao.org/mirrors/python/3.1/
http://npm.taobao.org/mirrors/python/3.10.0/
http://npm.taobao.org/mirrors/python/3.2.1/
http://npm.taobao.org/mirrors/python/3.2.2/
http://npm.taobao.org/mirrors/python/3.2.3/
http://npm.taobao.org/mirrors/python/3.2.4/
http://npm.taobao.org/mirrors/python/3.2.5/
http://npm.taobao.org/mirrors/python/3.2.6/
http://npm.taobao.org/mirrors/python/3.2/
http://npm.taobao.org/mirrors/python/3.3.0/
http://npm.taobao.org/mirrors/python/3.3.1/
http://npm.taobao.org/mirrors/python/3.3.2/
http://npm.taobao.org/mirrors/python/3.3.3/
http://npm.taobao.org/mirrors/python/3.3.4/
http://npm.taobao.org/mirrors/python/3.3.5/
http://npm.taobao.org/mirrors/python/3.3.6/
http://npm.taobao.org/mirrors/python/3.3.7/
http://npm.taobao.org/mirrors/python/3.4.0/
http://npm.taobao.org/mirrors/python/3.4.1/
http://npm.taobao.org/mirrors/python/3.4.10/
http://npm.taobao.org/mirrors/python/3.4.2/
http://npm.taobao.org/mirrors/python/3.4.3/
http://npm.taobao.org/mirrors/python/3.4.4/
http://npm.taobao.org/mirrors/python/3.4.5/
http://npm.taobao.org/mirrors/python/3.4.6/
http://npm.taobao.org/mirrors/python/3.4.7/
http://npm.taobao.org/mirrors/python/3.4.8/
http://npm.taobao.org/mirrors/python/3.4.9/
http://npm.taobao.org/mirrors/python/3.5.0/
http://npm.taobao.org/mirrors/python/3.5.1/
http://npm.taobao.org/mirrors/python/3.5.10/
http://npm.taobao.org/mirrors/python/3.5.2/
http://npm.taobao.org/mirrors/python/3.5.3/
http://npm.taobao.org/mirrors/python/3.5.4/
http://npm.taobao.org/mirrors/python/3.5.5/
http://npm.taobao.org/mirrors/python/3.5.6/
http://npm.taobao.org/mirrors/python/3.5.7/
http://npm.taobao.org/mirrors/python/3.5.8/
http://npm.taobao.org/mirrors/python/3.5.9/
http://npm.taobao.org/mirrors/python/3.6.0/
http://npm.taobao.org/mirrors/python/3.6.1/
http://npm.taobao.org/mirrors/python/3.6.10/
http://npm.taobao.org/mirrors/python/3.6.11/
http://npm.taobao.org/mirrors/python/3.6.12/
http://npm.taobao.org/mirrors/python/3.6.13/
http://npm.taobao.org/mirrors/python/3.6.14/
http://npm.taobao.org/mirrors/python/3.6.2/
http://npm.taobao.org/mirrors/python/3.6.3/
http://npm.taobao.org/mirrors/python/3.6.4/
http://npm.taobao.org/mirrors/python/3.6.5/
http://npm.taobao.org/mirrors/python/3.6.6/
http://npm.taobao.org/mirrors/python/3.6.7/
http://npm.taobao.org/mirrors/python/3.6.8/
http://npm.taobao.org/mirrors/python/3.6.9/
http://npm.taobao.org/mirrors/python/3.7.0/
http://npm.taobao.org/mirrors/python/3.7.1/
http://npm.taobao.org/mirrors/python/3.7.10/
http://npm.taobao.org/mirrors/python/3.7.11/
http://npm.taobao.org/mirrors/python/3.7.2/
http://npm.taobao.org/mirrors/python/3.7.3/
http://npm.taobao.org/mirrors/python/3.7.4/
http://npm.taobao.org/mirrors/python/3.7.5/
http://npm.taobao.org/mirrors/python/3.7.6/
http://npm.taobao.org/mirrors/python/3.7.7/
http://npm.taobao.org/mirrors/python/3.7.8/
http://npm.taobao.org/mirrors/python/3.7.9/
http://npm.taobao.org/mirrors/python/3.8.0/
http://npm.taobao.org/mirrors/python/3.8.1/
http://npm.taobao.org/mirrors/python/3.8.10/
http://npm.taobao.org/mirrors/python/3.8.11/
http://npm.taobao.org/mirrors/python/3.8.2/
http://npm.taobao.org/mirrors/python/3.8.3/
http://npm.taobao.org/mirrors/python/3.8.4/
http://npm.taobao.org/mirrors/python/3.8.5/
http://npm.taobao.org/mirrors/python/3.8.6/
http://npm.taobao.org/mirrors/python/3.8.7/
http://npm.taobao.org/mirrors/python/3.8.8/
http://npm.taobao.org/mirrors/python/3.8.9/
http://npm.taobao.org/mirrors/python/3.9.0/
http://npm.taobao.org/mirrors/以上是关于JenkinsX构建前端解决npm依赖包慢的问题的主要内容,如果未能解决你的问题,请参考以下文章

ping首包慢的问题(及icmp对应关系)

若依框架(前后端分离)打war包部署到linux

自建yum源解决Ceph搭建过程中从官网取包慢的问题

Python 技术篇 - python镜像推荐,实现python最新官方安装包飞速下载,解决www.python.org官网无法访问下载安装包慢问题

解决idea下载依赖包慢到出奇

maven 相关