• DevOps
  • maven 打包很慢 git拉取代码 很慢

maven 打包很慢

问题是什么
如何 缓存呢 还有就是 拉取代码的时候 需要 40

3 年 后

顶一下 , git fetch 能否支持配置超时时间 和 pipline 的maven 缓存配置

git fetch 不支持超时时间, 如果你需要复杂的git 配置,请使用 checkout。 参考 https://www.jenkins.io/doc/pipeline/steps/git/

maven 缓存,请参考 https://docs.kubesphere.com.cn/v4.1.1/11-use-extensions/01-devops/03-how-to-use/05-devops-settings/04-set-ci-node/ 设置ci node。 其原理是使用节点上的hostpath 缓存目录:

root@i-7jumnupo:/var/data# ls
jenkins_go_cache  jenkins_maven_cache  jenkins_nodejs_npm_cache  jenkins_nodejs_yarn_cache  jenkins_sonar_cache
root@i-7jumnupo:~# kubectl -n kubesphere-devops-system get cm jenkins-casc-config  -o yaml | grep "/var/data"
                    hostPath: "/var/data/jenkins_sonar_cache"
                    hostPath: "/var/data/jenkins_nodejs_yarn_cache"
                    hostPath: "/var/data/jenkins_nodejs_npm_cache"
                    hostPath: "/var/data/jenkins_sonar_cache"
                    hostPath: "/var/data/jenkins_maven_cache"
                    hostPath: "/var/data/jenkins_sonar_cache"
                    hostPath: "/var/data/jenkins_go_cache"
                    hostPath: "/var/data/jenkins_sonar_cache"
                    hostPath: "/var/data/jenkins_python_pip_cache"
                    hostPath: "/var/data/jenkins_python_pipenv_cache"
                    hostPath: "/var/data/jenkins_sonar_cache"
                      hostPath: "/var/data/jenkins_sonar_cache"
                      hostPath: "/var/data/jenkins_nodejs_yarn_cache"
                      hostPath: "/var/data/jenkins_nodejs_npm_cache"
                      hostPath: "/var/data/jenkins_sonar_cache"
                      hostPath: "/var/data/jenkins_maven_cache"
                      hostPath: "/var/data/jenkins_sonar_cache"
                      hostPath: "/var/data/jenkins_go_cache"
                      hostPath: "/var/data/jenkins_sonar_cache"
                      hostPath: "/var/data/jenkins_python_pip_cache"
                      hostPath: "/var/data/jenkins_python_pipenv_cache"
                      hostPath: "/var/data/jenkins_sonar_cache"

你也可以修改 jenkins-casc-config ,将hostpath换成pvc。

    3 个月 后