how to build on branch creation but not build on other scm event/commit?

2020-09-16 Thread Tim Black
1. I have a multibranch pipeline job that takes 30min to run, has a lot of branches, and my company is still at the earlier stages of devops transformation, so with our current infrastructure we do not want to trigger a build every commit. 2. Our job pipeline uses parameters heavily, so I

Re: Get build number of spawned job?

2020-09-16 Thread zil...@gmail.com
Thanks Gianluca, again. However, I found out it's much easier. I do this for each Pipeline1 and Pipeline2 def commonJOb = build job: "CommonPipeline", wait: true copyArtifacts projectName: 'CommonPipeline', fingerprintArtifacts: true, filter:

Re: Get build number of spawned job?

2020-09-16 Thread Gianluca
You can pass parameters to downstream jobs (Jenkins terminology for the jobs started via "build job") with the BUILD_ID of the upstream job (Jenkins terminology for the job that called "build job"): build job: "CommonPipeline", wait: true, parameters: [ [name: UPSTREAM_ID, value:

Re: Get build number of spawned job?

2020-09-16 Thread zil...@gmail.com
IOW, both Pipeline1 and Pipeline2 jobs have this String buildNum = copyArtifacts projectName: 'CommonPipeline', fingerprintArtifacts: true, filter: 'SomeFile.yml' selector: specific(buildNumber) What do I put in the ? thanks, Chris  Reply all Reply

Re: Get build number of spawned job?

2020-09-16 Thread zil...@gmail.com
IOW, both Pipeline1 and Pipeline2 jobs have this String buildNum = copyArtifacts projectName: 'Utilities/Playground/ECS-dependecy-checker', fingerprintArtifacts: true, filter: 'SomeFile.yml' selector: specific(buildNumber) What do I put in the ?

Get build number of spawned job?

2020-09-16 Thread zil...@gmail.com
If I spawn a job in jenkins, like this Pipeline1: build job: "CommonPipeline", wait: true You see this in the Jenkins console for Pipeline1 Scheduling project: CommonPipeline Starting building: Starting build CommonPipeline #100 Now if I start another pipeline at the same time Pipeline1

Re: Share files between pipelines?

2020-09-16 Thread zil...@gmail.com
Thanks. On Wednesday, September 16, 2020 at 11:55:53 AM UTC-4 Gianluca wrote: > The error is very verbose. > So ... or the project name is incorrect ... or the user running Pipeline2 > doesn't permission to see "Pipeline1". > > You can check the project name by looking at the Jenkins user

timeout option ignored in pipeline

2020-09-16 Thread Sébastien Hinderer
Dear all, I just added a timeout option to a pipeline: pipeline { agent { label 'foo' } options { timeout(time: 1, unit: 'HOURS') } stages { ... } post { ... } } The timeout is not taken into account. The job is running for several hours now and blocked whereas I was expecting it

Re: Share files between pipelines?

2020-09-16 Thread Gianluca
The error is very verbose. So ... or the project name is incorrect ... or the user running Pipeline2 doesn't permission to see "Pipeline1". You can check the project name by looking at the Jenkins user interface for "Full project name: " See screenshot. Ah ... remember that you have to

Share files between pipelines?

2020-09-16 Thread zil...@gmail.com
I posted this in Stackoverflow but i thought I'd post it here too, since this is a Jenkins specific group https://stackoverflow.com/questions/63923156/sharing-files-between-jenkins-pipelines I want to share a file between two different pipelines, running on 2 different nodes. I tried to use

Re: View all credentials on an instance (global, folders, users, ...)

2020-09-16 Thread Geoffroy J
Thanks Ivan, this is a great start and it is properly listing folder-level credentials. I just need to make the output more user friendly, especially adding the scope of the credential. On Mon, 14 Sep 2020 at 18:08, Ivan Fernandez Calvo wrote: > I think this groovy script is what you want >

Re: Best approach for trigger build only new added branches when scan multi-branch pipeline

2020-09-16 Thread Gianluca
I can see some ways to achieve that. You can look at the "triggeredBy" option to use in the "when" block to avoid build the pipeline is not triggered but what you want. For example, we do this: when { anyOf { triggeredBy 'UpstreamCause' triggeredBy 'UserIdCause' } } Because we

Jenkins with MacOS Agent - iOS app ARCHIVE FAILED error

2020-09-16 Thread Ashish Sharma
Hi All, We are facing an issue while building iOS app using mac agent for jenkins. We are using fastlane to build app. App is building properly if we connect our agent directly by* launching agent jnlp file (connect using browser option)*. However it fails and give "** ARCHIVE FAILED**"

Best approach for trigger build only new added branches when scan multi-branch pipeline

2020-09-16 Thread BTH
Dear folks, I have a limited resources Jenkins server and a bunch of multi-branch pipelines which are poll from GitLab repositories (scripted jenkins pipeline ). Then I've noticed that my Jenkins usually crash by run out of memory when someone click on scan multi-branch and its triggers build

Re: Bash Shell output as Jenkins Choice Parameter

2020-09-16 Thread Gianluca
Hi Kenny, I think you still need to get the output from shell script to groovy and then parse it. The "sh" command has a parameter to return the stdout of the script. So, starting from the Groovy script you mentioned ... then I would remove all code related to "cmd.execute" and I will change

Push Jenkins-Job shell- and powershell code to git?

2020-09-16 Thread Michael Renner
Moin, we have many jobs with extensive shell- und powershell code in the build sections. Is there a chance to push the code to our internal GitLab server as soon as the code/job was modified and saved? That would be an easily accessible backup that would allow to recover a previous version if