Can 2 Jenkins instance use the same agents (aka slaves)? - jenkins

I plan for second Jenkins instance tests that our jobs all work with the latest Jenkins and plugins version.
Can 2 Jenkins instance use the same agents (aka slaves) ?
so there would not be any conflicts/bugs in recent and 1-year-old Jenkins versions.

Related

Standard Jenkin (LTM)from linux server to cloudbees migration

Recently we have a requirement to move all the jobs from linux jenkins (standard) or LTM to cloudbees .
Could you please help me with step by step what n all we should take care ??
We are using aws instance for slave and only available plugins to support our jobs(no custom plugin written)

Jenkins 2.x Slave-Agent Variables in Pipelines

I have tried every permutation that I can find to pull a pre-existing variable from a specific Jenkins Slave and I cannot find a solution.
We have a git branch variable defined on each slave agent as a default branch for all builds initiated on that slave. This is to ensure that all DSL scripted job config is tested on our dev machine before it is promoted to a higher jenkins environment.
I have created a pipeline that will build all the components needed to stand up a new jenkins (with all of our enterprise deployment pipelines created) and it needs access to that one specific variable to correctly build the jobs based on the jenkins master/slave combo that it is running on.
I need a way (in a jenkinsfile) to access the variables that are configured on a particular jenkins slave machine.

spread job equally on Jenkins slaves

I added 3 new slaves to my jenkins master, so at the total my master has 5 powerful slaves. All of them from the same instance type (RAM/CPU, Disks and same network).
My Master jenkins is 2.78.
I am not using "Restrict where this project can be run" plugin. However, Jenkins executes builds mostly on slave1 and slave2. It rarely executes jobs on slaves[3-5].
Is there a configuration option within Jenkins, that prioritises the slaves?

Jenkins - Preventing jobs from using a particular slave

I have a Jenkins server with a good number of jobs. Recently, I decided to implement slave servers to reduce the server load. Everything went fine until I had this new requirement. Almost all of the java jobs are compiled with OpenJDK 7. Now there are some new projects requiring to be compiled with open jdk 8 and sun jdk 7 and 8. I decided to install new slaves with openjdk 8 and sun jdk 7 and 8 (three separate slaves) and assign those jobs with those requirements using the 'Restrict where this job can be run'option. However, how can I prevent the existing jobs from getting compiled in the new slaves (i.e. I want them to be compiled on the slaves with openjdk 7)?
Master Jenkins is 1.598 running on Redhat 6.5.
Thanks
I found the answer myself. The slave jar, as found in this page, takes two arguments - mode and label. I start those slaves where the jobs to be prevented from running, with an 'exclusive' mode (and a specific label). On the master side I assigned those jobs for those slaves using the 'Restricted to <label>' option. Normal slaves run with a 'normal' mode where any un-restricted jobs can be run. Please let me know if the answer(and/or the question/requirement) is not clear.
You can use Jenkins labels. Please assigne the following labels to the relevant slave machines: jdk8, sun-jdk7 and sun-jdk8.
Next on your jobs, enable this option: "Restrict where this project can be run"
And select the relevant label.

Can I use jenkins to trigger Build on another jenkins

I want to know if it is possible to run a build on jenkins through another jenkins.
I have two separate jenkins running on two different computers how can I possibly run a build job on one of them from the other ?
If I am building an iphone application and I try to build and deploy it through jenkins, I know I need a mac to develop iphone apps but do I need a jenkins to be running on a mac to build and deploy those applications or can it be running on any computer with any os ?
By the sounds of it you don't need another jenkins instance but a jenkins slave. This is used to build jenkins jobs on other platforms.
I have slave that run on WinXP, Win7 32bit, Win7 64bit and Ubuntu. However my jenkins instance runs on Ubuntu (not the same as the slave). This way jobs can be created with specific labels that will correspond to labels on the slaves.
Example:
job 1, label: ios
job 2, label: winxp
jenkins master: label ubuntu
jenkins slave1: label ios
jenkins slave2: label winxp
This way job 1 will only run on slave 1 and job 2 will only run on slave2 and you don't need to do anything about it.

Resources