zoukankan      html  css  js  c++  java
  • NetCore搭建Jenkins遇到的问题点

    需求: NetCore项目 通过jenkins实现自动构建,部署,静态扫描(Sonar)

    Jenkins、Sonar的安装就不赘述了,网上一搜一大堆; 闲话少说直接讲问题点

    系统配置: CentOS 7.2 ,Docker 


    问题1:  Jenkins设置Admin User账号密码后   过了一会怎么都无法登录,提示密码错误

    解决方案:     原文链接:https://blog.csdn.net/zsdoudou/article/details/98486108

      1. 注释config.xml文件 

           2、启用安全设置

      3、重置admin密码


    问题2:  NetCore项目配置的构建指令失败

    解决方案: 根据自己的NetCore版本和linux服务器版本 安装netcore sdk   
         安装地址:https://dotnet.microsoft.com/download/dotnet-core


    问题3: 获取不到公司/第三方的NuGet包   原文链接:https://www.cnblogs.com/YahuiWang/p/jenkins-docker-dotnet-core-publish.html

    解决方案:  配置jenkins_home/.nuget/NuGet/NuGet.Config      

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
        <add key="nuget.cnblogs.com" value="https://nuget.cnblogs.com/v3/index.json" />
        <add key="dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" value="https://dotnet.myget.org/F/aspnetcore-dev/ap
    i/v3/index.json" />
        <add key="192.168.1.32:9001/nuget" value="http://192.168.1.32:9001/nuget" />
      </packageSources>
      <packageRestore>
        <add key="enabled" value="True" />
        <add key="automatic" value="True" />
      </packageRestore>
      <bindingRedirects>
        <add key="skip" value="False" />
      </bindingRedirects>
      <packageManagement>
        <add key="format" value="0" />
        <add key="disabled" value="False" />
      </packageManagement>
    </configuration>
    

      


    问题4: Jenkins 插件安装总是超时

    解决方案: 替换插件源地址   我替换成清华大学的镜像站 : https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

        


     

    问题5: Jenkins集成Sonar配置Token ; 搜了一些案例应该都是老版本的jenkins  可以直接配置Token   新版本是Server authentication token

    解决方案:    选择凭据类型为 Secret Text 将 Token输入至Secret中

           

      


    问题6 : NetCore 2.1以上 使用SonarQube  不在使用MSBuild了,改用 dotnet scanner     

        引用:https://www.cnblogs.com/myzony/archive/2018/06/27/9233667.html              

    解决方案:   官网地址:https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/


    问题 7: Jenkins集成Sonar, NetCore使用dotnet scanner ,  jenkins构建都是成功的,  Sonar显示“主分支没有代码行”

      

       

                 在jenkins容器中执行   dotnet sonarscanner  提示 “No executable found matching command "dotnet-sonarscanner"”

        

     解决方案:   执行Shell的时候  需要提前初始化下环境  . /etc/profile

            

  • 相关阅读:
    arcgis10.4.X的oracle数据库要求
    面试高峰期,如何应对面试官的jvm刁难,特写一篇jvm面经(第一部)
    某公司面试打分文档,75分通过
    git-github 提示Permission denied (publickey) (windows)
    jar项目 BeanDefinitionParsingException: Configuration problem:Unable to locate Spring NamespaceHandler for XML schema namespace
    关于No Spring WebApplicationInitializer types detected on classpath的提示,tomcat 卡主
    spring+orm框架的兼容问题
    程序员常用工具
    IDEA-常见问题
    IDEA-基本设置
  • 原文地址:https://www.cnblogs.com/gmander/p/11766525.html
Copyright © 2011-2022 走看看