Jenkins

2019 DevOps 必备面试题——DevOps 理念篇

落花浮王杯 提交于 2020-12-13 01:46:36
原文地址: https://medium.com/edureka/devops-interview-questions-e91a4e6ecbf3 原文作者:Saurabh Kulshrestha 翻译君:CODING 戴维奥普斯 你是一位 DevOps 工程师还是想进入 DevOps 领域的新手?如果是,那么你已经把握住了未来趋势。在本文中,我列出了几十个在雇佣 DevOps 工程师时,面试官可能会问到的问题以供参考。 理解 DevOps 的关键点在于它不仅仅是一种技术集合,而是一种思维方式、一种文化。DevOps 需要一种文化转变——将运维与开发相结合,并需要一个相关联的技术工具链来促进协作变革。由于 DevOps 理念仍处于非常初级的阶段,因此 DevOps 的应用以及适应和协作所需的带宽因团队而异。但是,你可以开发 DevOps 技能组合,提升自我,成为任何类型的团队都需要的理想候选人。 成为一名 DevOps 工程师有哪些要求? 在寻找能胜任 DevOps 工程师的人选时,团队会有一套清晰的技能需求。其中最重要的是: 熟悉基础架构自动化工具,如 Chef,Puppet,Ansible,SaltStack 或 Windows PowerShell DSC。 熟练掌握 Ruby,Python,PHP 或 Java 等语言。 帮助你跨团队和角色进行沟通和协作的人际关系技巧。

一文读懂DevOps

梦想与她 提交于 2020-12-12 21:41:30
抽象的 DevOps “ DevOps 是使软件开发和 IT 团队之间的流程自动化的一组实践,以便他们可以更快,更可靠地构建,测试和发布软件。DevOps 的概念建立在建立团队之间协作文化的基础上,这些团队过去一直在相对孤岛中运作。” 类似于这种的 DevOps 相关的描述听起来特别抽象,非常学术,非常教科书,让人感觉无法落地,不知道该如何入手。很多团队在了解 DevOps,实践 DevOps 的时候不能很好的多维度看待 DevOps,实践的过程也很痛苦,不知道这种新型的理念如何实际提升自己团队的战斗力。 本文从开发和运维两个视角多层次的讲解什么场景应该 Dev 和 Ops、什么场景应该 DevOps,即 DevOps 的分与合,并使用一个 Demo 示例告诉大家 DevOps 中的关键步骤持续部署如何实践。 DevOps 的两个视角 DevOps 从字面上看就是开发和运维,也有翻译为开发运维(运营)一体化。我们这里的两个视角不是别的东西,正是开发和运维。这里的开发,不能简单的理解为开发工程师,指代的是整个软件的研发过程所含的所有要素,涵盖需求分析、开发、测试等等,其终点是可交付的软件制品。同样运维不仅仅是运维工程师,指代的是软件交付后投产过程以及后续的运营,反馈等系列过程,其起点是接受交付的软件制品。 这么两个视角的区分是隐含着软件工程背后的逻辑的,就像一栋大楼

Using groovy to parse JSON object in shell scripts for Jenkin

此生再无相见时 提交于 2020-12-12 12:09:26
问题 Say I have a JSON as following: {"id":"1.0.0-6", "version":"1.0.0", "build":6, "tag":"android-v1.0.0-6", "commitHash":"5a78c4665xxxxxxxxxxe1b62c682f84", "dateCreated":"2020-03-02T08:11:29.912Z"} I want to take out the version id from it in Jenkins Groovy file and pass the version id to a JIRA Plugin called XRAY so that it will create a build version as Label in JIRA. stage('Get App version') { steps { container('devicefarm') { steps { sh "LATEST_VERSION=$(curl ${APP_ARTIFACTORY_URL}/${XRAY

Using groovy to parse JSON object in shell scripts for Jenkin

谁说胖子不能爱 提交于 2020-12-12 12:08:24
问题 Say I have a JSON as following: {"id":"1.0.0-6", "version":"1.0.0", "build":6, "tag":"android-v1.0.0-6", "commitHash":"5a78c4665xxxxxxxxxxe1b62c682f84", "dateCreated":"2020-03-02T08:11:29.912Z"} I want to take out the version id from it in Jenkins Groovy file and pass the version id to a JIRA Plugin called XRAY so that it will create a build version as Label in JIRA. stage('Get App version') { steps { container('devicefarm') { steps { sh "LATEST_VERSION=$(curl ${APP_ARTIFACTORY_URL}/${XRAY

Using groovy to parse JSON object in shell scripts for Jenkin

北战南征 提交于 2020-12-12 12:07:50
问题 Say I have a JSON as following: {"id":"1.0.0-6", "version":"1.0.0", "build":6, "tag":"android-v1.0.0-6", "commitHash":"5a78c4665xxxxxxxxxxe1b62c682f84", "dateCreated":"2020-03-02T08:11:29.912Z"} I want to take out the version id from it in Jenkins Groovy file and pass the version id to a JIRA Plugin called XRAY so that it will create a build version as Label in JIRA. stage('Get App version') { steps { container('devicefarm') { steps { sh "LATEST_VERSION=$(curl ${APP_ARTIFACTORY_URL}/${XRAY

How to cleanup pipeline before checkout of repository in Jenkinsfile

末鹿安然 提交于 2020-12-12 11:39:48
问题 I want to make a clean before checkout operation which is described in Jenkins git plugin documentation: Clean before checkout Clean the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. ... But how can add this option to default checkout step which is doing as first step? I feel that it should be an option extended by git plugin which can be included to options block of Jenkinsfile as described in docs: The

Condition in Jenkins pipeline on the triggers directive

一笑奈何 提交于 2020-12-12 11:36:33
问题 Jenkins has a nice relatively comprehensive documentation about Jenkinsfile syntax. But I still not find there an answer is it possible to do a flow control on the top level of pipeline? Literally include something if just in pipeline {} section (Declarative) like: pipeline { if (bla == foo) { triggers { ...configuration } } or pipeline { triggers { if (bla == foo) { something... } } } triggers section is a section which can be included only once and only in the pipeline section. But if

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died with ChromeDriver and Selenium

↘锁芯ラ 提交于 2020-12-12 10:49:08
问题 I'm running a bunch of test cases every hour using selenium-java 3.12.0; TestNG; Selenoid with docker, Jenkins. Sometimes (about 1 out of 10 cases) I get the error: org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z' System info: host: 'autotest.rvkernel.com', ip: '94.130.165.217', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-26

Get SSH slave node hostname/IP in Jenkins pipeline

梦想与她 提交于 2020-12-12 08:29:16
问题 I'm using SSH slaves as nodes in a Jenkins pipeline script. Is there a way to fetch the hostname/IP of the node inside the pipeline (Jenkinsfile) script ? I'm deploying to a parameterized node and would like to echo the IP of the node at the end of the script. i.e: node('master') { checkout scm stash name: 'deploy', includes: 'modules/ci/,modules/compose/' } stage ('Deploy to remote server (SSH)') { node(${NODE}) { unstash 'deploy' withEnv(["BRANCH=${BRANCH}"]) { sh "chmod +x modules/ci

Get SSH slave node hostname/IP in Jenkins pipeline

[亡魂溺海] 提交于 2020-12-12 08:28:48
问题 I'm using SSH slaves as nodes in a Jenkins pipeline script. Is there a way to fetch the hostname/IP of the node inside the pipeline (Jenkinsfile) script ? I'm deploying to a parameterized node and would like to echo the IP of the node at the end of the script. i.e: node('master') { checkout scm stash name: 'deploy', includes: 'modules/ci/,modules/compose/' } stage ('Deploy to remote server (SSH)') { node(${NODE}) { unstash 'deploy' withEnv(["BRANCH=${BRANCH}"]) { sh "chmod +x modules/ci