One instance of Jenkins to call another - jenkins

I have Jenkins as the CI server. I have an automated testing tool setup on another machine. I installed Jenkins on the other machine also. Now I want one instance of Jenkins to trigger the project build on the other instance of Jenkins. Is that possible?

You can do this by pinging a build URL. i.e.
http://server-url:{port}/job/{job_name}/build

Easiest is to use the Parameterized Remote Trigger Plugin. Calling the URL directly can be tricky if your build has parameters and / or your Jenkins instance is secured.

Related

Sending gitlab webhooks from local instance of gitlab to local instance of jenkins

I have a local instance of Jenkins.
What i need isto launch a jenkins pipeline triggered by a local commit or push on a gitlab instance.
For several reasons of testing, i need to keep all in localhost.
So, what i'm struggling with is:
It's possible to install a local instance of gitlab on windows 10 (I've heard about gitlab runner, could it be suitable for sending webhooks?)?
How to set the webhooks from gitlab to my localhost jenkins?
Thanks anyone
Following might help you.
You need to integrate the Jenkins Job with the Gitlab Instance.
In Gitlab Instance you have to activate the Jenkins Integration
and
Decide on the trigger you want to use to trigger the
jenkins pipeline. (In my case only Push Trigger is active)
Then you need to provide details
Jenkins instance URL
Jenkins Pipeline Job Name
Authentication with a jenkins account user id and password.
Once you do this each you do the trigger action in the gitlab the pipeline will be triggered.

How to checkout repository on remote server using Jenkins Pipeline Script?

I want to checkout repository into remote server, not into the slave/master which executes the job. Is it possible ?
You can only use pipeline steps on agents, so machines that don't have an agent installed will have to be dealt with using external tools. Alternatively, you can choose a mixed approach if it fits you: use the checkout step on a Jenkins node, then move the code to another server using a shell/batch command.

Communicate between Jenkins server without setting up master slave relation

I would like to set up jenkins server that would run test scripts based on successful build deployments on other Jenkins servers. for example, if the QA jenkins server is named JQA1OnMachine1 and i have three others that are named
J2OnMachine2, J3OnMachine3, J4OnMachine4 (different jenkins server on different boxes) can the JQA1OnMachine1 (QA jenkis) poll the others at regular interval to see if a build was deployed successfully? if so can anyone tell me how?
Jenkins master slave along with Jenkins Pipeline Plugin would be one of the better ways to implement this however, since you don't want to use that approach you can explore PSTools to remotely capture processes or files on different server.
Your builds may update a file on the build server post completion of the build and your QA machine can run script with PSTools to monitor and trigger the QA testing based on the file content

How to modify jenkins Web Interface to pick artifacts to publish?

I have an project to upgrade my jenkins. So the problem is I use jenkins plugins called "Publish over ssh". As I read that plugin can publish our artifactory file to another server by ssh connection. But in the configuration it always run after our job finised. So every jobs that I run, always publish to server.
So, I want to ask, how can I pick which build history artifacts that I want to publish? and it can publish when I want to publish. And then I have an Idea to adding button in jenkins web interface, to trigger adding job configuration, build it, and publish it over SSH. But, I don't know how to modify jenkins web interface. My server use tomcat, that run java ".war" file.
So, do you all have suggestion for my problem, how to modify jenkins web interface, or how to pick certain build artifacts?
Thanks...

run a Jenkins job on another Jenkins instance from the Jenkins job

I want to create a Jenkins job that starts other Jenkins jobs. That would be quite easy, because Jenkins Template Project Plugin allows us to create a build step of a type "use builders from another project". However, what makes my situation harder is that I have to start Jenkins jobs on other machines. Is there any standard way to do that?
In case you want only to trigger new build of Job You Have plenty of ways to accomplish it
you can use remote access API and Trigger a request to build target job from source Job.
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
Or you can use https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Remote+Trigger+Plugin
which is handy in handling server details and other stuff. you shoukld ensure ssh keys shared by both servers.

Resources