Jenkins

Jenkins pipeline java.io.NotSerializableException java.util.regex.Matcher error even with @NonCPS

a 夏天 提交于 2020-04-07 14:34:03
问题 I am using @NonCPS in front of my Jenkinsfile function which performs a regex match and i'm still getting java.io.NotSerializableException java.util.regex.Matcher error even with the @NonCPS annotation. Note, it calls the function many times and the exception only occurs once a match is actually made. Here is my code: @NonCPS def extractEndTime(logLine) { def MY_REGEX = /.*(20[0-9]{2}-[0-9]{2}-[0-9]{2}).([0-9]{2}:[0-9]{2}:[0-9]{2}).*\"\w+\"\sthe text\s(\w+)\./ m = (logLine =~ TEST_LOGLINE_END

Jenkins pipeline java.io.NotSerializableException java.util.regex.Matcher error even with @NonCPS

混江龙づ霸主 提交于 2020-04-07 14:32:08
问题 I am using @NonCPS in front of my Jenkinsfile function which performs a regex match and i'm still getting java.io.NotSerializableException java.util.regex.Matcher error even with the @NonCPS annotation. Note, it calls the function many times and the exception only occurs once a match is actually made. Here is my code: @NonCPS def extractEndTime(logLine) { def MY_REGEX = /.*(20[0-9]{2}-[0-9]{2}-[0-9]{2}).([0-9]{2}:[0-9]{2}:[0-9]{2}).*\"\w+\"\sthe text\s(\w+)\./ m = (logLine =~ TEST_LOGLINE_END

Jenkins

*爱你&永不变心* 提交于 2020-04-07 11:23:48
1.jenkins修改默认端口号(8080) 修改配置文件 /etc/sysconfig/jenkins 找到8080改为你想使用的端口号 重启服务,修改后的端口号即可生效 2.jenkins启动|关闭|重启服务命令 service jenkins start|stop|restart 来源: oschina 链接: https://my.oschina.net/guiguketang/blog/3222778

Change email address in Git

∥☆過路亽.° 提交于 2020-04-07 11:10:35
问题 I have a project hosted in Git stash. It is built using jenkins. Now I made a typo while installing my Git locally. Like @ab.com instead of @abc.com After every build, jenkins sends email notifications and it picks up my incorrect email address from Git commit and tries to send it. Even after I have changed the email address in my local Git, I still see jenkins sending the emails to the old incorrect address. How can I fix this? 回答1: Locally set email-address (separately for each repository)

Jenkins+Git+Maven+Shell+Tomcat持续集成

人走茶凉 提交于 2020-04-07 10:53:55
准备工作 Git版本控制服务器 Tomcat发布服务器 Jenkins服务器(提前安装好Maven,Git,Jdk) 实验时可以在同一台机器配置,但是生产不建议,一台机器挂了,所有服务器都挂了 。 步骤 安装Jenkins 下载Jenkins War包, Jenkins官网 。 启动Jenkins ,将War包放入Tomcat容器里,启动Tomcat。 提示: 此时Jenkins在初始化配置目录,其默认配置目录路径为当前用户下的.jenkins目录,用户也可以自定义目录,Jenkins默认是把配置文件中的数据读到内存中,如果你替换了之前的配置文件,此时需要 点击Jenkins的读取设置或者重启Tomcat ,如果此时Jenkins页面无响应,则应该查看Tomcat的Catalina.out,多半是由于内存溢出造成(解决方法增大Tomcat调用Java虚拟机时内存大小,本文不做重点),运行Jenkins的服务器配置最好内存1G以上,因为后续会加入一些Jenkins插件,有一些会比较占用内存,导致Jenkins启动不了。 安装Jenkins插件 Email Extension Plugin (邮件通知) GIT plugin (可能已经默认安装了) Publish Over SSH (远程Shell) 安装方法: 首页->系统管理->管理插件->可选插件->过滤(搜索插件名)->勾选-

pytest+jenkins安装+allure导出报告

心已入冬 提交于 2020-04-07 04:01:41
环境安装: windows7+64位 pytest :4.0.2 allure 的安装 : allure 的 python 库 pytest-allure-adaptor jenkins 的安装 :2.138.2 JDK 1.8 一、 pytest pytest的安装不做说明,可以通过pytest --version查看安装的版本 二、安装 Allure Pytest Adaptor Allure Pytest Adaptor是Pytest的一个插件,可以通过它生成Allure所需要的用于生成测试报告的数据 pip install pytest-allure-adaptor 三、jenkins的简单安装 前提:注意JDK的版本问题,本测试使用的是1.8的版本 如已安装,通过java -version检查版本 1.安装jenkins jenkins默认安装在c盘 C:\Users\Administrator\.jenkins下,但由于权限的问题,最好安装在其他位置。 新建一个系统变量:JENKINS_HOME,值为D:\jenkins,或者其他目录也可以。再将此路径添加至Path里。 jenkins的下载地址: https://jenkins.io/download/ 选择的是2.138.2的版本 选择的是jenkins.war 下载成功后,将

Jenkins+Allure 构建脚本报错提示Can't find allure commandline <null>

旧巷老猫 提交于 2020-04-07 03:55:32
关于allure遇到几个问题,百度都没有解决方法,有些还是翻墙找到,有些是自己琢磨了好久发现,做个记录。 问题1、构建脚本接受后提示: Can't find allure commandline <null> 解决方法: 1、查看全局配置,Allure Commandline,安装目录设置,如果选择自动安装不会出现在该错误可以忽略;如果非自动安装,则需要选择allure目录,不是bin目录下的allure文件, 比如下图,/usr/bin/allure; 问题2、Exception in thread "main" ru.yandex.qatools.allure.data.ReportGenerationException: Could not find any allure results 原因:allure版本太低,下载解压最新的版本(一定要最新版本) 问题3:Allure测试报告中没有behavior和package模块 解决方法:在项目中Allure Report的advanced中添加Allure Configuration 配置,可以用 Allure Commandline安装目录下config下的xml配置 问题4、Allure测试报告中的用例数是实际的2倍,用例详情没有任何内容。 原因:pom文件里多了ru.yandex.qatools.allure的jar包

Jenkins 安装和配置、启动jar包

痞子三分冷 提交于 2020-04-06 07:56:55
一、下载 jekins.war 包 下载地址 https://jenkins.io/doc/book/installing/ 二、安装 将war包放在tomcat中,并且启动tomact。启动成功后 访问 http://192.168.52.129:8080/jenkins/ ,输入密码点击登录, 密码存放在位置,可以通过页面提示获取路径 vim /root/.jenkins/secrets/initialAdminPassword 接着出现如下情况,这个时候就会卡住,刷新也没用的。需要重新配置 hudson.model.UpdateCenter.xml vim /root/.jenkins/hudson.model.UpdateCenter.xml 修改后 http://mirror.xmission.com/jenkins/updates/update-center.json 重新启动 tomcat , 然后登录 配置 jdk 和 maven 系统管理-全局工具配置,这里的路径对应着是你的服务器路径 安装插件 没有看到可用插件,点击 checknow 刷新一下。结果报错 解决方案如下。 替换为 http://updates.jenkins.io/update-center.json 。 再重新启动tomcat 。 下面就是所有可用的插件列表。 根据需要安装我们需要的插件

How can I do string to integer conversion in a Jenkinsfile?

怎甘沉沦 提交于 2020-04-06 07:23:16
问题 I have the following in my Jenkinsfile: pipeline { agent none environment { timeout_mins = 1 } options { timeout(time: "${env.timeout_mins}", unit: 'MINUTES') } stages { stage("test print") { steps { echo "timeout_mins: ${env.timeout_mins}" sh "sleep 120" } } } } I'd like to re-use environment params such as timeout_mins in multiple places, but need to convert it to integer in certain places for certain plugins. The error I get with the above example is as follows: Processing environment for