jenkins-pipeline

Jenkins pipeline (parallel && dynamically)?

主宰稳场 提交于 2019-12-04 14:34:41
问题 Question I have simple parallel pipeline (see code) which I use together with Jenkins 2.89.2. Additionally I use parameters and now want to be able to in-/decrease the number of deployVM A..Z stages automatically by providing the parameter before job execution. How can I dynamically build my pipeline by providing a parameter? Researched so far: Jenkins pipeline script created dynamically - Not getting this to work with my Jenkins version Can I create dynamically stages in a Jenkins pipeline?

Invoke a remote jenkins file from another Jenkinsfile

故事扮演 提交于 2019-12-04 13:57:55
问题 I am designing a Jenkins CICD pipeline at my organization and I have a following question. I am from a devops team that controls the Jenkins pipeline for multiple development teams. I basically want to write a Jenkins file with multiple stages that can be run by multiple teams. I understand that this Jenkins file can be checked into the Gitrepo of each team and it can invoke the complete pipeline as soon as the changes are done to the code repo. To make sure that this JenkinsFile is

Complex and long single-job Jenkins Job Pipeline Builds: There yet?

眉间皱痕 提交于 2019-12-04 13:35:15
问题 TL;DR Does it make sense to have one single Jenking Job Pipeline job for a full long-running deployment / "build" chain in the free Jenkins, given that resumable checkpoint s are not available? Prelude I'm looking at the current incarnation of Jenkins' the open/free Pipeline Bundle. I'll note that I think that what you get for free here is quite simply amazing, seeing as most of the stuff (workflow-jobs themselves, stage-view, ...) was only part of the commercial enterprise bundle of

Catching multiple errors in Jenkins workflow

守給你的承諾、 提交于 2019-12-04 13:09:07
My workflow sends mails when it fails using a try-catch. i have also enable concurrency and with this, when multiple jobs of the same workflow enters into a throttling stage, the new ones cancels the older ones. This throw an exception of "org.jenkinsci.plugins.workflow.steps.FlowInterruptedException" And canceled jobs also triggers the mail notification. Now i have modified my workflow to catch the specific FlowInterruptedException exception and suppress the mail notice and let anything else to trigger the mail, like so. node { try { // some stages for the workflow } catch (org.jenkinsci

jenkins pipeline catch build_job info for a failed parallel build

北城以北 提交于 2019-12-04 12:21:20
Does anyone know how to catch the failed job's number in a parallel pipeline execution while still have failFast feature working for short-circuiting of builds in the event of a job failure? I know i can kind-of make it work if i do "propagate = false" while running the build step but that kills the failFast feature, and i need that. For example, below is my code and i want the value of variable achild_job_info inside the catch block as well. build_jobs = [“Build_A”, “ Build_B”, “ Build_C”] def build_job_to_number_mappings = [:] // in this hashmap we'll place the jobs that we wish to run def

Jenkins multibranch pipeline Scan without execution

六月ゝ 毕业季﹏ 提交于 2019-12-04 09:57:21
问题 I´m starting to create my pipeline multibranch environment but i have founded a problem. Can I run a build scan only to detect the branches with a Jenkinsfile but without the pipeline execution? My projects have different branches and i dont want when i launch a build scan from the parent pipeline multibranch all the children pipelines foreach branches with a Jenkinsfile starts to execute. Thanks by the help! 回答1: In your Branch Sources section you can add a Property named Suppress automatic

Store the console output of a build step execution in Jenkins pipeline

眉间皱痕 提交于 2019-12-04 09:54:11
In my jenkins pipeline i use the "Execute shell command " to run my gradle build script. Now i want to check if the build has failed in which case i would like to read the console output, store it in a string and publish it to a slack channel. The code that i have tried goes as follows : try { for (int i = 0 ; i < noOfComponents ; i++ ){ component = compileProjectsWithPriority[i] node { out = sh script: "cd /home/jenkins/projects/${component} && ${gradleHome}/bin/gradle build", returnStdout: true} } } catch (e){ def errorSummary = 'Build failed due to compilation error in '+"${component}"+'\n'

Docker pipeline's “inside” not working in Jenkins slave running within Docker container

∥☆過路亽.° 提交于 2019-12-04 09:20:12
I'm having issues getting a Jenkins pipeline script to work that uses the Docker Pipeline plugin to run parts of the build within a Docker container. Both Jenkins server and slave run within Docker containers themselves. Setup Jenkins server running in a Docker container Jenkins slave based on custom image ( https://github.com/simulogics/protokube-jenkins-slave ) running in a Docker container as well Docker daemon container based on docker:1.12-dind image Slave started like so: docker run --link=docker-daemon:docker --link=jenkins:master -d --name protokube-jenkins-slave -e EXTRA_PARAMS="

Publish Multiple Robot Test Results From Jenkins Pipeline

拜拜、爱过 提交于 2019-12-04 08:14:30
I have a Jenkins 2.0 Pipeline script that runs a two separate suite of Robot tests. The script tries to publish both test suite results, however the publisher over-writes the first publish, with the last one. node('robot') { ... publishTestResults('journey') publishTestResults('regression') } void publishTestResults(String type) { step([ $class : 'hudson.plugins.robot.RobotPublisher', outputPath : 'portfolio-app\\target\\robot-output\\' + type, passThreshold : 100, unstableThreshold: 100, otherFiles : '', reportFileName : '*\\report*.html', logFileName : '*\\log*.html', outputFileName : '*\

How to configure a Jenkins Pipeline for SonarQube scan

喜欢而已 提交于 2019-12-04 08:06:27
I am trying to configure a jenkins pipeline for my project, but there is something missing here, if anyone could direct on what I am doing wrong: Below is the pipeline script: node { stage('SonarQube analysis') { // requires SonarQube Scanner 2.8+ def scannerHome = tool 'sonarScanner'; withSonarQubeEnv('SonarQube 6.2') { bat "${scannerHome}/bin/sonar-runner.bat" } } } Below is the Jenkins Sonar Plugin related configurations: Under Manage Jenkins > Configure System : Under Manage Jenkins > Global Tool Configuration Below is the error that I get: D:\jenkins\workspace\Test_Pipeline>D:\sonar