zoukankan      html  css  js  c++  java
  • 部署Jenkins遇到的坑和解决方案

    1. Finished: FAILURE
    一般在Windows下安装Jenkins,默认workspace目录,在c盘xxx下,之间是有空格的,后期用cmd命令行执行命令会报错
    这时候就需要将目录的路径移动一下
    如何?
    设置电脑的环境变量,JEKNINS_HOME = 比如我为D盘下的新建文件夹,命令Jenkinds
    然后到安装目录下查找Jenkins.xml文件,将其中的JENKINS_HOME由BASE改为%JENKINS_HOME%
    将原先Base下的目录全部copy到D盘新建目录下
    之后重新打开即可

    2.Jenkins 的根 URL 为空,但对于 Jenkins 的很多特色是必需的,例如:邮件通知, PR 状态更新,以及像 BUILD_URL 一样的环境变量。

    请在 Jenkins 配置 提供一个准确的值。

    3. 手残误删了Jenkins运行的java进程,结果。。。。

     用管理员身份启动cmd

    然后进入jenkins目录。运行 net start jenkins

    否则会报系统错误5

     

    延伸: net stop jenkins

    4. 如何安装maven插件

    进入系统管理 ----  插件管理  ----  用页面自带的搜索安装Maven Integration

    5. 本地全局工具的配置

    使用本地jdk

    使用本地maven

    只要到本地maven的解压目录即可,我这边新建了一个目录maven

    使用本地git

     6. 不显示中文

    这边分两种,一种是Jenkins就没有中文插件,第二种是别人的浏览器打开是中文,而你的是英语

    第一种的解决办法,就是下载中文插件,我这边在安装的时候自行下载的一个local啥的

    第二种,和自己的浏览器设置有关,比如我之前的浏览器,优先的语言是英文,修改优先的语言为中文即可

    7. 更改对应的端口

    网上很多教程的更改方式是执行的时候用java -jar jenkins.war  --httpPort=8081

    windows用msi安装的,启动的时候并没有用jave -jar,就需要去Jenkins安装目录下找到xml文件,然后更改其中的port,在重启一下

    <!--
      Windows service definition for Jenkins.
    
      To uninstall, run "jenkins.exe stop" to stop the service, then "jenkins.exe uninstall" to uninstall the service.
      Both commands don't produce any output if the execution is successful. 
    -->
    <service>
      <id>Jenkins</id>
      <name>Jenkins</name>
      <description>This service runs Jenkins automation server.</description>
      <env name="JENKINS_HOME" value="%BASE%"/>
      <!--
        if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
        The following value assumes that you have java in your PATH.
      -->
      <executable>%BASE%jreinjava</executable>
      <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%jenkins.war" --httpPort=5118 --webroot="%BASE%war"</arguments>
      <!--
        interactive flag causes the empty black Java window to be displayed.
        I'm still debugging this.
      <interactive />
      -->
      <logmode>rotate</logmode>
    
      <onfailure action="restart" />
      
      <!-- 
        In the case WinSW gets terminated and leaks the process, we want to abort
        these runaway JAR processes on startup to prevent corruption of JENKINS_HOME.
        So this extension is enabled by default.
      -->
      <extensions>
        <!-- This is a sample configuration for the RunawayProcessKiller extension. -->
        <extension enabled="true" 
                   className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension"
                   id="killOnStartup">
          <pidfile>%BASE%jenkins.pid</pidfile>
          <stopTimeout>10000</stopTimeout>
          <stopParentFirst>false</stopParentFirst>
        </extension>
      </extensions>
      
      <!-- See the referenced examples for more options -->
      
    </service>

    8. 如果查看密钥比如地址/var/lib/jenkins/secrets/initialAdminPassword,自己没有权限

    那也没有关系,可以在log日志中看到生成的密钥,注意是要找到安装的日期的log哟

      

  • 相关阅读:
    Java 学习笔记(10)——容器
    Java 学习笔记(9)——java常用类
    Java 学习笔记(8)——匿名对象与内部类
    OGC相关概念解析
    Django中URL有关
    转载关于Python Web后端开发面试心得
    ArcPy中mapping常见函数及用法1
    Django1.11加载静态文件
    ArcPy第一章-Python基础
    浅谈提高Django性能
  • 原文地址:https://www.cnblogs.com/qianjinyan/p/10769929.html
Copyright © 2011-2022 走看看