jenkins-pipeline

Issues with multibranch pipeline job DSL

孤街浪徒 提交于 2019-12-25 00:19:57
问题 I am having issues with multibranch pipeline for job DSL plugin to automate the creation of multibranch pipeline job. The piece am having issues with is how to let set the path to the Jenkinsfile on the repo. I have looked online for documentation but found nothing to help. I have even tried to get example scripts but multibranch job DSL scripts are rare on the internet. Matter of fact could not find any that has Jenkinsfile set in it jobs.groovy folderName = "${JENKINS_PATH}" folder

Uploading iOS .ipa file to testflight via Jenkins

折月煮酒 提交于 2019-12-25 00:15:59
问题 I might be late to the CI/CD party but better late than never. So far, I am able to setup Jenkins on a separate MAC which does not contain XCode. I use this MAC as a 24x7 small server for minor operations. A lot of time was wasted for archiving and then uploading that build to testflight for my iOS apps so I thought of setting up a CI/CD process. After the Jenkins setup, I am able to generate the .ipa file for specified target (release/debug). Now I want to upload this .ipa file to Testflight

Jenkins pipeline - How to read the success status of build?

本秂侑毒 提交于 2019-12-25 00:13:29
问题 Below is the output after running the build(with success): $ sam build 2019-06-02 15:36:37 Building resource 'SomeFunction' 2019-06-02 15:36:37 Running PythonPipBuilder:ResolveDependencies 2019-06-02 15:36:39 Running PythonPipBuilder:CopySource Build Succeeded Built Artifacts : .aws-sam/build Built Template : .aws-sam/build/template.yaml Commands you can use next ========================= [*] Invoke Function: sam local invoke [*] Package: sam package --s3-bucket <yourbucket> [command] && echo

How to execute powershell script from jenkins by passing parameters

℡╲_俬逩灬. 提交于 2019-12-24 22:53:08
问题 I have a powershell script in my Github. i am trying to execute that via Jenkins. Here is a part of the script :- param ( + [string]$fileDir = "%WORKSPACE%\src\Project\***", [string]$packagingDir = "%WORKSPACE%\src\packageTemp", [string]$staticFilesToDeploy = "%WORKSPACE%\src\****" ) Now i am using a simple batch execution within Jenkins Job to run this script. I am trying to run it as powershell -noexit "& ""%WORKSPACE%\src\***.ps1""" But when Jenkins actually executes this powershell script

jenkins & labels getting : pending—master is offline while trying to execute on non-master nodes

社会主义新天地 提交于 2019-12-24 21:04:54
问题 I have a Jenkins instance where I am not able to use labels, builds are triggered but get stuck at "pending—master is offline". I have disabled the master (executor # : 0) as I do not wish to use it. Instead I would expect the build to go to the next available node with the label mentioned in the pipeline. node("mylabel"){ echo " jenkins pipeline for mylabel nodes" } This works in a clean install of jenkins so I can only assume this is a configuration/compatibility issue on my master instance

how to keep process running after the stage is finished for declarative jenkins pipeline

♀尐吖头ヾ 提交于 2019-12-24 19:04:24
问题 pipeline { agent none stages { stage('Server') { agent{ node { label "xxx" customWorkspace "/home/xxx/server" } } steps { sh 'node server.js &' //start server } } stage('RunCase') { agent{ node { label 'clientServer' customWorkspace "/home/xxx/CITest" } } steps{ sh 'start test' sh 'run case here' } } } } I create above Jenkins pipeline. What I want to do is: 1. start server at server node. 2. start test at test node. However, I found the server process will be closed when second stage start.

groovy to list Jenkins jobs with GIT URL used in jobs

北城以北 提交于 2019-12-24 18:40:38
问题 We need to print Jenkins jobs URLs and GIT URL configured inside these jobs. For example: Assume my Jenkins URL is : http://localhost:8080 & my git URL is ssh://git:424 If i run groovy code from Jenkins, It should return: http://localhost:8080/job_name1 | ssh://git:424/repo_name1 (GIT URL configured in SCM section of job_name1) http://localhost:8080/job_name2 | ssh://git:424/repo_name2 (GIT URL configured in SCM section of job_name2) I have below code to list jobs : Jenkins.instance

How rerun failed test cases of cucumber-jvm in jenkins

无人久伴 提交于 2019-12-24 17:51:45
问题 How to rerun failed test cases of cucumber-jvm in jenkins? According to answers mentioned in this thread: How to rerun failed test cases in cucumber-jvm? There is different maven command to move and run scenarios for rerun.txt. How to execute them in Jenkins with separate maven command for rerun? 回答1: I use cucumber-serenity framework, which uses cucumber-jvm in the background to run everything. Here are the relevant parts of my pom. I have everything in a separate project, not mixed with any

Getting bad substitution error when bumping up version using maven versions plugin in Jenkins pipeline

不羁岁月 提交于 2019-12-24 11:37:26
问题 I get a bad substitution error when I run this command in my jenkins pipeline sh 'mvn build-helper:parse-version versions:set \ -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}-SNAPSHOT \ -DgenerateBackupPoms=false \ -DprocessAllModules \ -DgenerateBackupPoms=false' This is the error message in this case - [code] Running shell script /apps/jenkins/latest/workspace/ess-holani_master

How to set “Scan Organization Triggers” via Jenkins script console?

冷暖自知 提交于 2019-12-24 11:29:36
问题 I need a way to set “Scan Organization Triggers” via the Jenkins script console. This is close, but only shows Multibranch or Organization Scan triggers if they already exist: https://github.com/cloudbees/jenkins-scripts/blob/master/setOrgFolderIndex.groovy 回答1: Here's a script that I made that detects multibranch or organization triggers. If the project doesn't already have one, it will create a trigger. Note: the addTrigger part is commented out, so this should be safe to run as-is. import