jenkins-pipeline

Jenkinsfile Pipeline DSL: How to Show Multi-Columns in Jobs dashboard GUI - For all Dynamically created stages - When within PIPELINE section

不羁岁月 提交于 2019-12-24 06:25:23
问题 Jenkins 2.89.4 rolling I saw almost all stackoverflow posts which show how we can successfully run parallel steps/stages (using list/maps etc) --OR hardcoding them directly --OR even create dynamic stages for Jenkinsfile (as seen in this post: Scripted jenkinsfile parallel stage) My requirements are: A pipeline which builds N. no of projects under "BUILD" steps i.e. parallel builds on each of those projects . i.e. it runs Gradle on all N projects. Here I have a Jenkinsfile which was created

Jenkins and SSL certificates

混江龙づ霸主 提交于 2019-12-24 06:04:39
问题 Firstly my exposure and experience with certificates is limited so I am trying to use this as a learning experience as well as obtaining an answer. Using Jenkins I would like to be able to make a curl request as part of my build that uses a certificate (.p12) to authenticate. Example curl --cert /Users/Jenkins/.jenkins/workspace/develop-pipeline/../certificates/dev_cert.p12:password https://jira.dev.organisation.co.uk:443/rest/api/2/issue/MYSTATS-1234 So I have a Desktop certificate (private

Assigning variables in a parallel step using Declarative Pipeline steps in Jenkins

孤者浪人 提交于 2019-12-24 05:47:07
问题 I'm trying to convert my Scripted pipeline to a Declarative Pipeline and running in some basic (I think) issues. stage ('Deploy to Docker') { steps { parallel ( "instance1" : { environment { containerId = sh(script: "docker ps --quiet --filter name=${fullDockerImageName}", returnStdout: true).trim() } steps { .... } } ) } } This causes the following Exception: WorkflowScript: 197: Expected a step @ line 197, column 29. containerId = sh(script: "docker ps --quiet --filter name=$

How to use GitHub commit message and commit id inside Jenkins pipeline?

旧城冷巷雨未停 提交于 2019-12-24 04:03:11
问题 I am using DevOps model, where i have built a pipeline for code build and deploy. In the entire process i want to log the Git commit id and commit message for that specific change commits. @shruthibhaskar shruthibhaskar committed just now 1 parent 51132c4 commit aedd3dc56ab253419194762d72f2376aede66a19 and commit message and description as below test commit 3 test commit desc 3 how do i access these values of commit inside my jenkins pipeline, where i have configured a webhook for SCM polling

How to change JAR build path in Jenkins?

◇◆丶佛笑我妖孽 提交于 2019-12-24 03:52:59
问题 I am building a Java project via Jenkins. The JAR is being created (after I execute maven clean install in Jenkins) in C:\Windows\System32\config\systemprofile.m2\repository\com\other folders. Is there any way to change this path? I want to sent the JAR to a VM via SSH. However, I am not able to access this folder since this is system directory. Thank you. 回答1: For some reason, your Jenkins uses this directory as local Maven repository. I would define a different local repository in Jenkins

How to pass multi select value parameter in Jenkins file(Groovy)

不羁的心 提交于 2019-12-24 03:34:40
问题 E.g. Below code is used for single select value choice{ choices: 'Box\nOneDrive\nSharePointOnline\nGmail\nGDrive\nGenericS3', defaultValue: 'box', description: 'Connector to build', name: 'On_Cloud_Devices_To_Test' } 回答1: I would use booleanParam's. Then the user can tick all the required options. booleanParam(defaultValue: false, name: 'ALL', description: 'Process all'), booleanParam(defaultValue: false, name: 'OPTION_1', description: 'Process option 1'), booleanParam(defaultValue: false,

How to pass multi select value parameter in Jenkins file(Groovy)

天涯浪子 提交于 2019-12-24 03:34:04
问题 E.g. Below code is used for single select value choice{ choices: 'Box\nOneDrive\nSharePointOnline\nGmail\nGDrive\nGenericS3', defaultValue: 'box', description: 'Connector to build', name: 'On_Cloud_Devices_To_Test' } 回答1: I would use booleanParam's. Then the user can tick all the required options. booleanParam(defaultValue: false, name: 'ALL', description: 'Process all'), booleanParam(defaultValue: false, name: 'OPTION_1', description: 'Process option 1'), booleanParam(defaultValue: false,

Why build executor status showing two jobs for one pipeline job?

匆匆过客 提交于 2019-12-24 00:33:45
问题 I am using a groovy pipeline script for a build job, so in jenkins pipeline is like, node { git url : 'myurl.git' load 'mydir/myfile.groovy' } Its working well as expected. but in build executor status, It is showing it as two jobs running. Why it is showing one job as two jobs with same name ?. Is there something which i have missed to tell something to jenkins for pipeline job? 回答1: I can't find a better documentation source than this README (issue JENKINS-35710 also has some information),

Jenkins Pipeline currentBuild.changeSets and retrieving emails per repository

本秂侑毒 提交于 2019-12-24 00:03:35
问题 I have a jenkins pipeline job, that check outs 3 repositories. When the build fails, depending on where it fails, I want to send emails to the developers which caused the last commits/changes. I can retrieve the authors fullNames with this: def changeSet = script.currentBuild.changeSets[0]; Set authors = []; if (changeSet != null) { for (change in changeSet.items) { authors.add(change.author.fullName) } } But I cannot figure out: How can I get the authors email? How can I distinguish the

How can I define additional parameters in jenkinsfile who inherit from a pipeline shared lib?

偶尔善良 提交于 2019-12-23 23:12:22
问题 I would like to add a possibility to extends the global parameters define in a Jenkins pipeline. Each JenkinsFile who call the default pipeline have default parameters and he as able to define parameters himself like this: @Library('mylib') _ generic_pipeline { parameters { choice(choices: namespaces, description: 'namespaces ?', name: 'namespaceIdChoice') string(defaultValue: "$BRANCH_NAME-$BUILD_NUMBER", description: 'What is the project name ?', name: 'projectName') } } my generic_pipeline