Groovy + Jenkins + Perforce - jenkins

I have a groovy script to send notifications. I need to run this as post build after each of my job in jenkins. I need to do this without manually updating each job.
Problems faced:
Tried to make this as jenkinsfile. But Pipleine script from perforce is buggy and cannot be used.
Any suggestions??

You can run a script after any job using plugins. Post build task this plugin will be useful in your case. No manual work needed after configured.

Related

How to schedule jenkins build from github, without jenkins configure?

I am running functional automation test with github and jenkins. I used to schedule jenkins job with 'Build with parameter' option. So with this option, I can run the jenkins pipeline at specific time with cron pattern.
But I want to schedule the job without jenkins UI, from github repository. How can I do it?
Please please help me!
In my github repo, I have jenkinsfile and YAML file.
Can I schedule it from there? Is there any way?
Or will I need to create any new file to schedule/trigger/run the jenkins pipeline at specific time?

Jenkins Pipeline - Can we run a job outside of jenkins pipeline?

I am using jenkins pipeline and my Jenkinsfile has several stages and jobs. Is there any way to run specific job outside of jenkins pipeline ?
Example: Let's say one of the stage is to do "scp build artifacts to remote location". For some reason this got failed and if at all I want to run rest of the jobs manually out of jenkins pipeline, how can I do that ?
I am least interested to invoke a new build. So can we run remaining jobs after failure outside of jenkins pipeline manually ?
You may be able to do it by writing unit test cases to your Jenkinsfile and test them as a maven project. This may or may not solve your problem without looking at your entire problem but if you can reorganize your logic to achieve 100% test coverage then it is doable. You can find more information about writing test cases of Jenkins pipelines here

Jenkins execute local Pipeline Script without SCM

I created this account because I couldn't find a solution for my problem. I hope you can help me. The goal is to write a local pipeline script for jenkins and use it in my pipeline (I'm using version 2.138). I don't want to write it in the jenkins UI or use any SCM (no git!). I saw that I can execute a shell scipt in a freestyle-job, but it doesn't work with pipelines. Maybe there is some plugin that can help me?

Is there a way to turn Jenkins job into a Jenkins DSL script automatically?

I use Job DSL Plugin to generate my Jenkins builds. But sometimes I make small changes to the build in Jenkins and I want to port those changes back to my DSL script automatically. Is there any way to achieve this?
Currently there is no way to generate a Job DSL script for an existing job. This has been reported in the Jenkins issue tracker as JENKINS-16360 some time ago and someone even offered a bounty, but AFAIK no one is working on the issue.

How to get URL of pipeline job in jenkins

We are setting up a continuous delivery pipeline in Jenkins, using the build pipeline plugin.
Our deployment steps uses a proprietary deploy tool (triggered by a HTTP request from jenkins), but we need to have an additional Jenkins step for acceptance tests on the then deployed project. So our deploy tool will need to trigger the last pipeline step.
The jenkins setup for this is obvious:
For a Manually Triggered downstream build step: To add a build step
that will wait for a manual trigger:
Select the Build Pipeline Plugin, Manually Execute Downstream Project check-box
Enter the name(s) of the downstream projects in the Downstream
Project Names field. (n.b. Multiple projects can be specified by using comma, like "abc, def".)
Source: Build Pipeline Plugin
The problem is: I can't seem to find a way to trigger this downstream build through a URL.
In fact I'd need the URL in the deploy job, so I can send it to the deploy tool as a callback URL. Can anybody help?
If I understand correctly, you want to use remote access API, which to my knowledge is no different between general project or pipeline one.
Take a look here:
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
Submitting jobs
Jobs without parameters
You merely need to perform an HTTP POST on JENKINS_URL/job/JOBNAME/build?token=TOKEN where TOKEN is set up in the job configuration.
As stated above by #rafal S do
read a file which has list projects name for which build job has to be triggered do a curl HTTP POST on JENKINS_URL/job/${JOBNAME from the file}/build?token=TOKEN within a for loop , where for loop has list of all project names from the file you read

Resources