1.下载war包

https://jenkins.io/download/

2.安装

java -jar jenkins.war

Error:
Feb 21, 2019 2:17:25 AM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start Jetty
at winstone.Launcher.<init>(Launcher.java:186)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at Main._main(Main.java:344)
at Main.main(Main.java:160)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:339)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:395)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at winstone.Launcher.<init>(Launcher.java:184)
... 7 more

解决:

修改Jenkins端口java -jar jenkins.war --httpPort=8081

jenkins plugin提示: Update information obtained: 不可用 ago;

出现堆栈错误;

解决:

我们将.jenkins/hudson.model.UpdateCenter.xml文件内容中的https://updates.jenkins.io/update-center.json改为http://updates.jenkins.io/update-center.json即可;即为https协议改为http协议;然后我们重启一下jenkins,插件即可正常搜索访问;

jenkins时区设置为上海时间

打开 【系统管理】->【脚本命令行】运行下面的命令

System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Shanghai')

jenkins 关闭和重启实现方式.

1、关闭Jenkins

只需要在访问jenkins服务器的网址url地址后加上exit。例如我jenkins的地址http://localhost:8080/,那么我只需要在浏览器地址栏上敲下http://localhost:8080/exit 网址就能关闭jenkins服务.

2、重启Jenkies

http://localhost:8080/restart

3、重新加载配置信息

http://localhost:8080/reload

3.项目配置(gerrit提交patch动态触发jenkins自动编译

①建立gerrit服务器连接



②确保手动触发的可执行性



③项目动态触发条件配置

4.构建脚本

以下是构建脚本可能需要的一些参数,仅供参考:

-----------------------------------------------------------Gerrit--triggered--parameters-------------------------------------------------------------

Trigger the build on Gerrit events.
The triggered build will be provided with the following parameters:
For all events
GERRIT_PROJECT: The name of the project.
GERRIT_EVENT_TYPE: The type of this event.
GERRIT_EVENT_HASH: A unique hash making all triggered builds unique in the queue.
GERRIT_EVENT_ACCOUNT: The name and email of the account associated with the event, if any. "Name" <name@somewhere.com>.
GERRIT_EVENT_ACCOUNT_NAME: The name of the account associated with the event, if any.
GERRIT_EVENT_ACCOUNT_EMAIL: The email of the account associated with the event, if any.
GERRIT_NAME: The name of the Gerrit instance that provided the event.
GERRIT_HOST: The hostname of the Gerrit instance that provided the event.
GERRIT_PORT: The port number of the Gerrit instance that provided the event.
GERRIT_SCHEME: The protocol name of the Gerrit instance that provided the event.
GERRIT_VERSION: The version number of the Gerrit instance that provided the event.
For events on a change (Patch set created, Draft published, Change merged, Change abandoned, Change restored, Comment added)
GERRIT_CHANGE_ID: The Change-Id.
GERRIT_CHANGE_SUBJECT: The first line of the commit message.
GERRIT_CHANGE_COMMIT_MESSAGE: The full commit message, UTF-8 Base64 encoded. (Only when Gerrit version is 2.8 or above).
GERRIT_CHANGE_NUMBER: The change number.
GERRIT_CHANGE_URL: The URL to the change.
GERRIT_PATCHSET_NUMBER: The Patch Set number.
GERRIT_PATCHSET_REVISION: The Patch Set revision id.
GERRIT_BRANCH: The name of the branch.
GERRIT_TOPIC: The name of the topic.
GERRIT_REFSPEC: The ref-spec. (refs/changes/xx/xxxx/z).
GERRIT_CHANGE_OWNER: The name and email of the owner of the change "Name" <name@somewhere.com>.
GERRIT_CHANGE_OWNER_NAME: The name of the owner of the change.
GERRIT_CHANGE_OWNER_EMAIL: The email of the owner of the change.
GERRIT_PATCHSET_UPLOADER: The name and email of the uploader of the Patch Set "Name" <name@somewhere.com>.
GERRIT_PATCHSET_UPLOADER_NAME: The name of the uploader of the Patch Set.
GERRIT_PATCHSET_UPLOADER_EMAIL: The email of the uploader of the Patch Set.
GERRIT_PATCHSET_ABANDONER: The name and email of the abandoner of the Patch Set "Name" <name@somewhere.com>.
GERRIT_PATCHSET_ABANDONER_NAME: The name of the abandoner of the Patch Set.
GERRIT_PATCHSET_ABANDONER_EMAIL: The email of the abandoner of the Patch Set.
GERRIT_PATCHSET_RESTORER: The name and email of the restorer of the Patch Set "Name" <name@somewhere.com>.
GERRIT_PATCHSET_RESTORER_NAME: The name of the restorer of the Patch Set.
GERRIT_PATCHSET_RESTORER_EMAIL: The email of the restorer of the Patch Set.
Additionally for Change merged events
GERRIT_NEWREV: The revision of the merge commit.
Additionally for Comment added events
GERRIT_EVENT_COMMENT_TEXT: The comment posted to Gerrit, UTF-8 Base64 encoded.
For Reference updated events
GERRIT_REFNAME: Ref name within project.
GERRIT_OLDREV: The old value of the ref, prior to the update.
GERRIT_NEWREV: The new value the ref was updated to.
The parameters will be available to the build as environment variables. E.g. $GERRIT_REFSPEC

【Gerrit】持续集成工具Jenkins的安装配置与使用过程中遇到的问题整理的更多相关文章

  1. 老李分享:持续集成学好jenkins之安装

    老李分享:持续集成学好jenkins之安装   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq: ...

  2. 持续集成工具Jenkins安装、部署、使用

    本文介绍jenkins,利用其做项目发布与持续集成交付工具. 一.Jenkins是什么? Jenkins是基于Java开发的一种持续集成工具,用于监控持续重复的工作,功能包括: 1.持续的软件版本发布 ...

  3. 持续集成工具Jenkins学习总结

    概述 持续集成(Continuous Integration,简称CI)是一种软件开发实践,团队开发人员每次都通过自动化的构建(编译.发布.自动化测试)来验证,从而尽早的发现集成错误.持续集成最大的优 ...

  4. 持续集成工具jenkins的使用

    jenkins类似于Hadson,是一款持续集成工具.使用jenkins完成自动化部署的表现为:当开发人员向版本库提交新的代码后,应用服务器上自动部署,用户或测试人员使用的马上就是最新的应用程序.搭建 ...

  5. 轻松搭建持续集成工具jenkins

    1.Jenkins介绍1)什么是持续集成随着软件开发复杂度的不断提高,团队开发成员间如何更好地协同工作以确保软件开发的质量已经慢慢成为开发过程中不可回避的问题.尤其是近些年来,敏捷(Agile) 在软 ...

  6. 持续集成工具——Jenkins

    一.jenkins简介 1.持续集成工具 2.基于JAVA环境 二.环境搭建 1.安装JDK 2.安装配置git 3.安装配置tomcat Tomcat是针对Java的一个开源中间件服务器(容器),基 ...

  7. 持续集成工具-Jenkins 使用介绍

    Jenkins 是一个可扩展的持续集成引擎,可以为我们提供代码自动编译.打包和发布工作,减少部署成本. 一.安装与启动 Jenkins 提供了多种便捷的安装方式,比较推荐使用执行 war 包的方式. ...

  8. CI工具Jenkins的安装配置【linux】——jenkins集成sonarqube-异常解决

    Setup 官网https://jenkins.io/ 下载war包,扔到tomcat下启动即可. 如果有port限制,在iptables中打开商品限制. 访问http://ip:port/jenki ...

  9. linux-centos下持续集成工具jenkins部署使用教程

    centos下准备工作: 1.安装jdk环境 2.安装maven环境(用于构建项目) 3.git客户端(用于拉取源码) 此外码云还要准备一份java源码(springboot项目) 一.安装jenki ...

随机推荐

  1. ajax传递list集合

    原文链接:https://blog.csdn.net/qq_37936542/article/details/79277495 一:ajax传递List<String>类型的数据 js代码 ...

  2. [CSS Flex] Flex direction

    flex-direction: main two 'row' or 'column', you can use reverse also.

  3. Android addTextChangedListener(文本监听)参数解释及实现EditText字数监听

    由于最近做项目要检测EditText中输入的字数长度,从而接触到了Android中EditText的监听接口,TextWatcher.它有三个成员方法,第一个after很简单,这个方法就是在EditT ...

  4. 并发新特性—Executor 框架与线程池

    兰亭风雨 · 更新于 2018-11-14 09:00:31 并发新特性-Executor 框架与线程池 Executor 框架简介 在 Java 5 之后,并发编程引入了一堆新的启动.调度和管理线程 ...

  5. boost-1.53源代码编译

    1.下载源代码.首先得明确,boost大多数库都仅仅有头文件.链接时不需Lib文件:下面库须要单独编译成库: Boost.Filesystem Boost.GraphParallel Boost.IO ...

  6. 【t003】string

    Time Limit: 1 second Memory Limit: 50 MB [问题描述] 设有字符串X,我们称在X的头尾及中间插入任意多个空格后构成的新字符串为X的扩展串,如字符串X为" ...

  7. 【u114】旅行计划(12月你好)

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 小明要去一个国家旅游.这个国家有N个城市,编号为1-N,并且有M条道路连接着,小明准备从其中一个城市出 ...

  8. VS2017 安装过程

    2017 安装过程 工欲善其事必先利其器 Visual Studio 2017 正式版官方下载地址:https://www.visualstudio.com/downloads/ 安装vs2017的时 ...

  9. 窗体的基类中没有设定大小,所以才不能居中,若要窗体居中,必须使用setfixedsize()函数或者resize()函数设定窗体的大小,居中才能正常使用

    最近开发中,遇到了窗体不能居中的问题,看了网上的很多文章,窗口居中,无非都是move至窗口的中心目标; 有两种方式, 一种在构造函数中直接计算中心坐标; 另一种是在窗口show后再move至相应坐标. ...

  10. Codeforces 15C Industrial Nim 简单的游戏

    主题链接:点击打开链接 意甲冠军: 特定n 下列n行,每一行2的数量u v 表达v礧:u,u+1,u+2···u+v-1 问先手必胜还是后手必胜 思路: 首先依据Nim的博弈结论 把全部数都异或一下, ...