Is it possible to trigger a job from Jenkins by parsing/receiving an event from Git/Gerrit Replica/Slave server? - jenkins

I would like to connect my Jenkins to the Git/Gerrit replica/slave server. I want my Jenkins server to start building job once a commit is merged in the replica server. It is possible with Git/Gerrit Main server, but not sure whether this can be achieved via Gerrit replica or slave server.

I don't see any problem, I think you just need to create an additional Gerrit server at:
Jenkins > Manage Jenkins > Gerrit Trigger > Add New Server
And point to the replica/slave server at "Hostname" and "Frontend URL" fields.

Related

Trigger JMeter tests on a remote system via Jenkins

how can we tell Jenkins to download and run JMeter tests on a remote system rather than from the Jenkins server itself?
My requirement is to create a job in Jenkins to download the latest code from a repo to another system where JMeter is installed and run the JMeter tests on that remote system rather than from Jenkins server itself? I can trigger the tests from Jenkins server itself but unable to connect to remote server and download/trigger the server.
You need to get familiarized with the concept of Jenkins Distributed Builds, it's enough to start Jenkins agent proces on the "remote system" and bind your job to execute on that agent instead of Jenkins master.
With regards to tracking changes in the remote repo check out Generic Webhook Trigger and How to Integrate Your GitHub Repository to Your Jenkins Project articles

Trigger Jenkins Multi-Branch Pipeline from GitLab push

I run a Gitlab and a Jenkins server locally. I connected those two using the gitlab-branch-source plugin. For every repository in gitlab i create a multibranch-pipeline job in jenkins. When a user pushes code, I want the corresponding job to be executed.
I'v tried a solution suggestend in this post and this one. Both of them don't seem to work.
In the gitlab server settings on the jenkins server I've set the check at "Manage Web Hooks". The personal access token which is used for the integration has the scopes "api, sudo".
What else could I try?

Trigger Jenkins job on code commit to Azure repository

I have a Jenkins job running on my localhost:8080. I want to trigger this job automatically whenever there is a commit on Azure repos (Azure DevOps).
Any advise on how I can achieve this?
Thanks
Since Jenkins job running on your localhost:8080. You need to create your self-hosted agents on the local machine which your jenkin server can communicate to. Then you need to create a azure pipeline to be triggered on Azure repos commit and run this azure pipeline on your self-hosted agent. You can check out below workarounds:
Enable Trigger builds remotely on Jenkins
Go the the Build Triggers Tab of your jenkins pipeline configure page--> Then check Trigger builds remotely--> Specify a Token (will be used in the URL)
Define a secret variable to host your jenkins password(eg. password) in azure devops pipeline:
Add a bash task in your azure devops pipeline to run the below curl command
#token must be the same with the token you entered in above step
curl -u $(username):$(password) http://localhost:8080/job/myproject/build?token=anytoken
Targeting your self-hosted agent pool to run your azure devops pipeline on self-hosted agent.
There is another workaround using Jenkins queue job task.
Create a API Token in your Jenkin server.
Go your jenkin account configure page. To create a API token.
Add Jenkins queue job task in azure devops pipeline
Click the Manage link to create a jenkins service connection--> In the newly opened page-->Create Service connection-->Select Jenkins--> Next
Enter the required information. Note: url is your local jenkin server. username is your user account for jenkin server, the Password is the API Token You generated in above step.
Another workaround is to configure the Poll SCM build triggers on your jenkins job. So that the jenkin server will periodically poll the source code and queue the job if there is new commit.
See this thread for more information.

Connection between 2 Jenkins server with out using master slave concepts

How to establish connection between Jenkins jobs hosted on different server with out using master slave concept
I need to send the parameters from one Jenkins server to another both were hosted in different server;
and i need to trigger a down stream project in another Jenkins server
You can use Parameterized remote trigger plugin: https://wiki.jenkins.io/display/JENKINS/Parameterized+Remote+Trigger+Plugin
There are two parts to use this plugin-
Configuration - Go to Manage Jenkins -> Configure System -> Parameterized Remote Trigger Configuration
fill the parameters as appropriate and check the connection using 'validate address' button. If it is validated successfully you are good to go.
Calling a job on remote server - In your job you can add a build step "trigger remote parameterized job".
Fill in the remote server name, poll interval, job name and other parameters.
Now when you will run your job, it will trigger the job on remote server and will check for status on the interval given in poll interval option.

Is there any way to integrate Bitbucket on cloud and Jenkins On premise

I am trying to integrate Bitbucket on cloud and Jenkins on premise, but once I enter the IP of my local Jenkins in Bitbucket cloud it show error URL not valid.
Is there a way to solve this, or do I need to buy Jenkins cloud license?
Your local Jenkins server is not seen by a cloud Bitbucket server because it is an internal server.
You can solve it in one of those alternatives:
Ask your system administrator to expose your Jenkins server with a global IP address along with the Jenkins port (e.g. 8080) so the Bitbucket server will be able to access it. This is not totally secure due.
Activate the Jenkins job that pulls from the remote BitBucket server on time internal - in the Job 'Build Triggers' section check the 'Poll SCM' checkbox and set the cron setting (for example: 'H/15 * * * *' for building every 15 minutes. Notice that it will not build if there were no code changes)

Resources