Jenkins

Jenkins REST API to get job and job console log

和自甴很熟 提交于 2020-08-22 06:19:06
问题 How to get the details of the job along with it console output using Jenkins REST API example of builds console output: I am using following commands to get the path of console log echo $JENKINS_HOME/jobs/$JOB_NAME/builds/${BUILD_NUMBER}/log echo $BUILD_URL/consoleText It would provide the path to console log http://localhost:8080/job/Echo/25//consoleText but if i try to get the data from it using c#.net it would through me a exception I am using following code to get the data public string

Jenkins REST API to get job and job console log

允我心安 提交于 2020-08-22 06:19:05
问题 How to get the details of the job along with it console output using Jenkins REST API example of builds console output: I am using following commands to get the path of console log echo $JENKINS_HOME/jobs/$JOB_NAME/builds/${BUILD_NUMBER}/log echo $BUILD_URL/consoleText It would provide the path to console log http://localhost:8080/job/Echo/25//consoleText but if i try to get the data from it using c#.net it would through me a exception I am using following code to get the data public string

How to hide passwords in Jenkins console output?

筅森魡賤 提交于 2020-08-22 04:07:06
问题 The Mask Passwords plugin only allows for preset passwords to be passed in to the build process, so it really does nothing for the security of the Job. I need a password parameter that needs to be entered every time the job is run (as a parameter) and I need that to be masked in the console output. From what I am reading, going to Manage Jenkins -> Configure System and selecting to mask Password Parameters should work, but it is not for some reason.. any suggestions? 回答1: Tested with Jenkins

Jenkins: How to make single job build and deploy on two servers

我是研究僧i 提交于 2020-08-21 19:42:28
问题 I have code in a repository. Now I want to create a job which will build code from the repository and deploy it on two servers. Right now I create two jobs with exactly the same configuration. The only change is the server on which it needs to deploy. Is it possible to do this with single job? 回答1: Can I suggest to use this maven plugin. You can configure batch tasks (either maven goals, or scripts) that you can attach to your normal maven jobs. https://wiki.jenkins-ci.org/display/JENKINS

appium+pytest+allure+jenkins 如何实现多台手机连接

别说谁变了你拦得住时间么 提交于 2020-08-20 08:04:17
使用appium可以实现app自动化测试,我们之前是连接一台手机去运行,如何同时连接多台手机呢?很多人可能想到的是多线程(threading)。今天分享一种比多线程更简单的方法,虽然不是多台手机同时运行,但可以连接多台手机依次运行,大致的运行方式是:001号测试用例:A手机,B手机...,002号测试用例:A手机,B手机... 环境准备 appium的安装 :adt,nodejs,appium的python库,appium server pytest的安装 :pytest allure的安装 :allure的python库pytest-allure-adaptor jenkins上插件的安装- 传送门 jenkins的安装 :windows上的安装- 传送门 手机/模拟器 :华为荣耀畅玩5C,夜神模拟器 框架改造 1. 配置改写 以上课所写的前程贷的自动化框架为主,框架的分层如下(框架分享 - 传送门:提取码: zvry ): 在上述框架中,我们的配置信息存在Caps目录下的Caps.yaml中,譬如这样 - platformName: Android platformVersion: 5.1.1 deviceName: JTG6T16307007427 appPackage: com.xxzb.fenwoo appActivity: .activity.addition

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

强颜欢笑 提交于 2020-08-20 07:52:50
接口自动化测试框架(用例自动生成) 项目说明 本框架是一套基于 pytest+requests+Python3.7+yaml+Allure+Jenkins+docker 而设计的数据驱动接口自动化测试框架, pytest 作为执行器,本框架无需你使用代码编写用例,那你可能会担心万一有接口之间相互依赖,或者说需要登入的token等之类的接口,该如何编写用例呢,在这里告诉你们本框架已经完美解决此问题,所有的一切将在yaml中进行!!本框架实现了在yaml中进行 接口用例编写,接口依赖关联,接口断言,自定义测试用例运行顺序 ,还有很重要的一点,实现了类 jmeter函数助手 的功能,譬如生成MD5、SHA1、随机定长字符串、时间戳等,只需要你在yaml中使用特殊的写法 $Function(arg)$ ,就能够使用这些函数啦,此外在测试执行过程中,还可以 对失败用例进行多次重试 ,其重试次数和重试时间间隔可自定义;而且可以根据实际需要扩展接口协议,目前已支持 http接口和webservice接口 。 技术栈 requests suds-py3 Allure pytest pytest-html yaml logging Jenkins docker 函数助手 环境部署 命令行窗口执行pip install -r requirements.txt 安装工程所依赖的库文件 解压allure

作为软件测试的前辈你能不能给我点建议?

梦想的初衷 提交于 2020-08-20 02:49:37
说点实在的。 1.买本java基础啃完。 2.买本jmeter基础啃完。 3.下个ide比如eclipse,然后写几个工具类,比如一些get,post的基本请求,json序列号和反序列化,基本的md5,aes/des基于盐的加解密,jdbc循环插入mysql造数据,xls和csv文件的操作等一些可能用到的东西。 4.把写完的打个jar包用jmeter建个beanshell瞎跑跑。 5.下个docker装点镜像,比如装个tomcat和mysql,正好上面用到 6.随便找个网站用fiddler这种抓包,然后里面找个接口用之前写的工具类请求下试试,用jmeter请求试试。 7.了解下Jenkins,如果有工具看下k8s然后把Jenkins和docker弄个最基本的持续集成环境,然后慢慢加一些工具和自己写的东西做自动化。 8.看看常用架构中mq,redis怎么用工具去连接查看,看看常用中间件和db中线程池,连接池的配置,看看表的索引这些东西。 9.看看selenium,在ide中引用它的包去做做功能自动化 10.看下unit,report工具类然后自己写个接口自动化框架测试技术类的基本就这些东西,剩下的项目经验你得去实际工作去慢慢积累。 原文链接:https://www.zhihu.com/question/392607753/answer/1311247386 来源: oschina

Kubernetes中利用Kubectl set 让Deployment更新镜像

只谈情不闲聊 提交于 2020-08-19 23:44:20
问题描述 我的deployment有单个pod,我的自定义docker镜像如下: containers: - name: mycontainer image: myimage:latest 在开发过程中,我想推送新的最新版本并更新Deployment。无法明确定义tag/version并为每个构建增加它,并且无法找到如何做到这一点: kubectl set image deployment/my-deployment mycontainer=myimage:1.9.1 问题回答 配置标签更新触发Deployment更新 您可以使用grace period(例如30秒或更长时间,根据容器启动时间和镜像大小)配置您的pod,并设置“imagePullPolicy:”Always“。并使用kubectl delete pod pod_name。将创建一个新容器并且最新镜像自动下载,然后旧容器终止。 例子: spec: terminationGracePeriodSeconds: 30 containers: - name: my_container image: my_image:latest imagePullPolicy: "Always" 我目前正在使用Jenkins进行自动构建和打镜像标签,它看起来像这样: kubectl --user="kube-user" --server=

jenkins基础,手动、自动代码上线

丶灬走出姿态 提交于 2020-08-19 17:23:04
1. jenkins基本介绍与使用 1.1 jenkins介绍 官网 https://jenkins.io Jenkins是一个开源的、可扩展的持续集成、交付、部署(软件/代码的编译、打包、部署)基于web界面的平台。 Jenkins是一个工具集,提供了各种各样的插件 比如获取git上最新的代码 比如可以帮你编译源代码 比如可以调用自定义的shell脚本远程执行命令 官方文档 https://jenkins.io/doc/ 1.2 jenkins安装方式 (1)docker (2)windows (3)linux (4)war (5)yum 1.3 jenkins下载 2. 安装jenkins 2.1 安装java依赖环境 [root@jenkins ~]# yum -y install java 2.2 安装jenkins并启动 [root@jenkins ~]# yum -y localinstall jenkins-2.176.1-1.1.noarch.rpm [root@jenkins ~]# systemctl start jenkins && systemctl enable jenkins jenkins.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin

DevOps生命周期,你想知道的全都在这里了!

我怕爱的太早我们不能终老 提交于 2020-08-19 03:12:17
在大多数情况下,软件应用程序开发由于其规范性和复杂性而变得很耗时。 为了在短时间内交付高质量应用程序,软件开发人员正在遵循一套通用的实践,称为DevOps生命周期。 那么,DevOps在软件应用程序开发领域中扮演着什么角色? 让我们深入了解其含义、用途以及DevOps生命周期中的每个关键阶段。 什么是DevOps 在DevOps之前,从业人员使用瀑布模型或敏捷开发模型进行软件项目开发:瀑布模型或顺序模型是软件开发生命周期(SDLC)中的一种开创性方法,在这个模型中,软件开发成为一个线性过程,不同的阶段和任务被依次定位;而敏捷开发涉及各种方法的使用和SDLC中多个团队的协作。瀑布模型的线性和敏捷开发的跨功能性无法确保快速、连续地交付无缺陷的软件应用程序。 软件行业日益清晰地认识到:为了按时交付软件产品和服务,开发和运维工作必须紧密合作。这样的情况下,DevOps应运而生。 DevOps是一个简单的缩写词,源于“development(开发)”和“Operation(运维)”两个词,它涉及以特定的方式实践应用程序开发的任务。更广泛地说,软件开发和IT运维的结合被称为DevOps。 DevOps的优势 DevOps在促进IT运维和软件开发之间的敏捷关系方面的有效性受到几个因素的支持。通过在软件开发和IT运维部门的多个业务部门内实现更好的通信