Jenkins

How to not mark Jenkins job as FAILURE when pytest tests fail

你离开我真会死。 提交于 2021-02-10 06:09:04
问题 I have a Jenkins setup with a pipeline that uses pytest to run some test suites. Sometimes a test fails and sometimes the test environment crashes (random HTTP timeout, external lib error, etc.). The job parses the XML test result but the build is marked as FAILURE as long as pytest returns non-zero. I want Jenkins to get exit code zero from pytest even if there are failed tests but I also want other errors to be marked as failures. Are there any pytest options that can fix this? I found

How to not mark Jenkins job as FAILURE when pytest tests fail

旧时模样 提交于 2021-02-10 06:07:15
问题 I have a Jenkins setup with a pipeline that uses pytest to run some test suites. Sometimes a test fails and sometimes the test environment crashes (random HTTP timeout, external lib error, etc.). The job parses the XML test result but the build is marked as FAILURE as long as pytest returns non-zero. I want Jenkins to get exit code zero from pytest even if there are failed tests but I also want other errors to be marked as failures. Are there any pytest options that can fix this? I found

How to not mark Jenkins job as FAILURE when pytest tests fail

此生再无相见时 提交于 2021-02-10 06:04:28
问题 I have a Jenkins setup with a pipeline that uses pytest to run some test suites. Sometimes a test fails and sometimes the test environment crashes (random HTTP timeout, external lib error, etc.). The job parses the XML test result but the build is marked as FAILURE as long as pytest returns non-zero. I want Jenkins to get exit code zero from pytest even if there are failed tests but I also want other errors to be marked as failures. Are there any pytest options that can fix this? I found

「前端工程化」该怎么理解?

自作多情 提交于 2021-02-09 13:40:10
关注「 前端向后 」微信公众号,你将收获一系列「用 心 原创」的高质量技术文章,主题包括但不限于前端、Node.js以及服务端技术 一.什么是前端工程? 一个类似的术语是软件工程(Software Engineering): Software engineering is the systematic application of engineering approaches to the development of software. 将工程方法系统化地应用到软件开发中,就叫软件工程 。那么,紧接着又有两个问题: 工程方法是什么? 系统化怎么理解? 工程是指使用科学原理设计和制造机器、结构等,比如修桥、铺路、建隧道、造车、盖房子: Engineering is the use of scientific principles to design and build machines, structures, and other items, including bridges, tunnels, roads, vehicles, and buildings. 具体到软件领域,指的是 以系统、严谨、可量化的方法开发、运营、维护软件 ,软件工程包括对这些方法的应用和研究: Software engineering the application of a systematic,

Exporting and Importing Jenkins Pipeline script approvals

泄露秘密 提交于 2021-02-09 11:53:09
问题 I have a significant set of Groovy pipeline scripts for our Jenkins build process. I am in the process of moving those scripts onto another instances, and would like to replicate the set of approved scripts that were not originally white listed. Is it possible to export the list of approved signatures and import them into another instance? The only other solution I have is to constantly run and rerun the scripts and approving each signature as it breaks the build. Since the scripts are quite

Get Jenkins BUILD_NUMBER variable and display it in angular application

只谈情不闲聊 提交于 2021-02-09 11:52:26
问题 I deploy an angular application by Jenkins and I want to display the build number in the footer of the page. I know that while Jenkins is running the job, it sents a system environment variable BUILD_NUMBER. I read some articles but none is saying how can we get this variable from the OS? 回答1: Here is a workaround. You can use pre and post build event to replace a version-tag in environment.prod.ts file. export const environment = { production: true, system: 'prod', version: '%VERSION%' };

How to get response code from curl in a jenkinsfile

空扰寡人 提交于 2021-02-09 11:01:12
问题 In a jenkinsfile I call curl with: sh "curl -X POST -i -u admin:admin https://[myhost]" and I get output like this: ... HTTP/1.1 204 No Content Server: Apache-Coyote/1.1 ... I would like to take different actions based on the response code from the above call but how do I store only the response code/reply in a variable? 回答1: By using the parameter -w %{http_code} (from Use HTTP status codes from curl) you can easily get the HTTP response code: int status = sh(script: "curl -sLI -w '%{http

Dynamic parameter based on previous string parameter

我与影子孤独终老i 提交于 2021-02-09 10:52:34
问题 In Jenkins I have a string parameter HOST . After this parameter I have a dynamic parameter URL . This parameter needs to be a concatenation of strings, including the previously defined HOST parameter. I have been unable to find out how to do this. The motivation for this is subsequent parameters will also use this HOST parameter. 回答1: Just make sure I understand your requirement correctly: you have two parameters and the later one is depends on the value of the first one? If it's so I think

自动化工具后起之秀Ansible的部署实践

ε祈祈猫儿з 提交于 2021-02-09 02:00:26
转载本文需注明出处:微信公众号EAWorld,违者必究。 从早期手动加脚本的部署方式,到后来自动化工具(chef, puppet, saltstack, ansible等)的出现,再到如今DevOps的盛行,企业应用部署正式进入平台部署阶段,CD(持续部署)已经成为企业对应用部署的标准需求,运维的交付也不再是以周或天为单位,而是以分钟为单位。 本文主要介绍自动化工具Ansible,及其在普元DevOps平台中的应用部署和日常应用部署中的实践。 本文目录: 一、如何选择合适的自动化工具? 二、Ansible架构图及工作流程 三、DevOps基于Jenkins+Ansible+GitLab的部署实践 四、Ansible日常应用部署实践 五、总结 一、如何选择合适的自动化工具? 面对众多的自动化工具(chef, puppet, saltstack, ansible等),我们该如何选择适合自己的呢?总的来说,无外乎从以下几点来权衡利弊。 活跃度(GitHub活跃度,社区活跃度) 学习成本 使用成本 编码语言 性能 各种开源的自动化工具在GitHub的关注度是其活跃度最直观的体现,从图中Contributors这一项就可以看出Ansible和SaltStack的开源项目贡献者远远多于其它几种自动化工具。越活跃的开源项目往往意味着更完善的功能和更高效的问题解决率。 Ansible

Jenkins Multibranch Pipeline Lightweight Checkout

放肆的年华 提交于 2021-02-08 21:48:31
问题 The Jenkins Pipeline plugin has a feature known as "lightweight checkout", where the master only pulls the Jenkinsfile from the repo, as opposed to the entire repo. There's a corresponding checkbox in the configuration screen. I'd like to do a lightweight checkout in a multibranch pipeline, but I'm not seeing a checkbox in the multibranch configuration screen. Any ideas how to make this happen? I noticed some closed issues that suggest this feature is available, but I wasn't able to find any