How to setup my remote slave with Jenkins? - ios

In therory Master is : Job and Slave is : Node (however that what im understand).
I installed JENKINS in 2 machines MAC OS X (maybe windows whatever), I set up my job with a correct repository and configure xCode in this job etc ... like same tutorial, i set up my slave etc ... all fine and 10/10 BUTTT this test is local test, in one machine.
My problem is : I want have SLave(Node) for building my xCode Project in MAC OS, and My Matser (job) in others server (why not my seconde machine MAC OS X), How i can establish connection between slave (Node) and Master(job) for building my project xCode in my Remote SLave.

Set your job to use "Restrict where this project can be run" by checking the box and put the name of the slave in the box (use quotes if there are spaces
I had a little trouble deciphering your questions so if this does not answer please rework what you are asking.

Easy set the IP address of the slave host machine in the Jenkins setup. Choose ssh as the communications method and set up accounting information on the slave machines jenkins setup. Make sure the slave machine can ssh to the account and machine you set up in jenkins. Your ready to roll

How to link jobs in Jenkins
Master job: "Trigger/call builds on other projects"
Slave job: Add a Condition Step build: "Run? Build Cause --> UpstreamCause (with The master project name)" and then copy the artifacts (.) from the "Master" job.
Don't forget to copy from the workspace and not from the latest successful build, since the master didn't finished yet and din't publish the artifacts.

Related

How do I tell Jenkins what to run on my slave machine?

My Jenkins master is up and running. I have created a slave node, launched it successfully from the slave machine, and have done the web services installation so that the connection is established on startup of the slave machine. I have also created a "job" that builds successfully in Jenkins.
How do I tell Jenkins what to actually do on my slave machine? I want to use Jenkins to run an IntelliJ test suite (Selenium and Cucumber) on the slave machine, but haven't been able to figure out exactly how to get it to do this. Note: I've just started looking into the Seleniumhq plug-in, but I'm not sure if this is what I need or not since I'm working with a remote slave.
Limit where the jobs can run using the 'Restrict where this project can be run' to your slave node.
Distributed Builds in Jenkins
My confusion here stemmed from not having my project connected to a VCS repository. Without it, I couldn't figure out how to build-out my project's workspace in the slave environment from Jenkins. I also didn't understand the concept of adding additional build steps at the time I asked this question.
Once I had the VCS connection set-up (I had to do some finagling with Git/Visual Studio Team Services to get it connected, which is why I went with "none" as my version control option at first), my workspace was built for me on the slave machine when I built the project from Jenkins. Then, I used a combination of build steps ("execute Windows batch command" and "Invoke top-level Maven targets") to carry-out the rest of the project's functions.

Jenkins: how to run an exe on a remote computer

I just started using Jenkins. Still not familiar with all its features.
I would like to run a Ranorex test which is on a remote computer. How can I do that from Jenkins?
To execute binaries on a specific host, you can use slaves.
Here is a guide to setup master and slave on windows:f
https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines+on+Windows
You will run the slave on the remote computer and connect it to the master.
To run the slave on your remote computer, you have to download the slave.jar and start it on the remote computer. This is described in the wiki article above.
You have to ensure, that your job is executed on the slave. This can be done by labels. You configure a label on the slave and configure the same label on the job too.

Running HP Load Runeer or QTP from Jenkins

I have HP Load Runner installed in Windows 2012 and its hosted in the cloud.
For running load runner scripts, I connect to the system via mstcs, open the Virtual User Generator application and run the scripts.
Now I want to run the scripts via Jenkins( installed in a different system ) and I tried using the Jenkins HP Application Automation Tools plugin but I was unable to figure out how to do that.
In Jenkins I found out the following option:
Execute HP functional tests from HP ALM
Execute HP tests from file system
Execute HP tests using HP ALM Lab Management
Execute HP tests using HP Performance Center
But I am not sure how to use them or any of these will work. Can some please help me with this?
For individual scripts alone, mdrv command line. For controller alone wlrun command line. You may refer to knowledge base articles on the arguments to employ.
Have you gone through the documentation for HP automation plugin for Jenkins?
At last I figured out how to integrate it.
Integrating HP Load Runner:
For Running HP Load Runner scrips there is a Jenkins plugin named HP Application Automation Tools.
The challenge for us was the fact that Jenkins and Load Runner were installed on separate machines. We had Jenkins installed in our Dev server and HP Load Runner installed on cloud. If both were installed on the same machine then the task would be as simple as providing the filesystem path for Load Runner Scenario *.lrs files, in Execute HP tests from file system plugin.
So I went ahead and installed a slave instance of Jenkins in our CTC in which Load Runner was installed.
Steps to setup Jenkins slave instance.
On your master machine go to Manage Jenkins -> Manage Nodes.
New Node --> Enter Node Name.
Select Dumb Slave --> Press OK.
Fill out the following:
Set a number of executors (one or more) as needed.
Set a Remote FS Root, a home directory for the master on the slave machine. For a Windows slave, use something like: "C:\Jenkins\"
Set a label so that you can use that label to run jobs on the slave machine.
Select the appropriate Usage setting.
Launch Method: An easy way to control a Windows slave is by using Launch slave agents via Java Web Start (Recommended for Windows).
Availability --> Keep this slave online as much as possible
Press OK.
Now you need to connect your slave machine to the master using the following steps.
Open a browser on the slave machine and go to the Jenkins master server url (http: //your jenkins master:8080/).
Go to Manage Jenkins > Manage Nodes, Click on the newly created slave machine. You will need to login as someone that has the "Connect" Slave permission if you have configured global security.
Click on the Launch button to launch agent from browser on slave.
Run the program.
Now you should see the Slave machine connected under Nodes.
If you want the service to run on start-up of the slave machine do the following (Windows only directions):
In the Slave agent program running on your slave machine, click File --> Install as Windows Service.
Start, type Services and Select the Services program.
Find Jenkins Slave in the list, Double click to open.
Select Startup type --> Automatic.
Go to the Log On tab, change the Log on as to a user of your choice (Special user account Jenkins recommended).
Make sure that auto login is set for the slave machine for the user account, then the VM (or physical computer) should connect and be available when needed.
Creating Load Runner job in Jenkins:
Create a new freestyle project in Jenkins.
Check the "Restrict where this project can be run" checkbox and choose the Label Expression what you have provided for Slave Jenkins.
Under Add build step select Execute HP tests from file system and inside the Tests textarea provide the path of the folder of cloud machine which is having your Load Runner Scenario *.lrs scripts .
Click on build, Jenkins will trigger the Jenkins slave instance in cloud machine which will in turn invoke the Load Runner Controller and run the controller scripts(*.lrs).
Integrating HP QTP Scripts:
Steps for integrating HP QTP Scripts are exactly same as for HP Load Runner, the only difference is :
HP Unified Functional Testing should be installed in the same machine where you are going to configure Jenkins as a slave instance.
Under Add build step select Execute HP tests from file system and inside the Tests textarea provide the path of the folder of CTC machine which is having your HP QTP scripts .
Running Windows Server 2012 R2 Datacenter in a VM & want it set up as a jenkins node to run HP ALM test sets. In step 6, setting jenkins slave to run as a service, I received 'access denied' from jenkins slave agent process. Open a cmd prompt as admin user, cd to the jenkins slave install directory and enter
jenkins-slave.exe install
to fix this. Next, run services, locate the jenkins slave service. Should say 'Automatic', so 'start' it up and trial run your jenkins job. Check by rebooting the new jenkins slave platform and checking the service comes back as 'Automatic'.

Jenkins- Create Jobs on different servers

I want to configure Jenkins to build my code on 1 server. Then want to deploy it on another server using Jenkins.Both servers are using Linux I want to automate the entire process as much as possible. I went through some of plugins like pipeline, Job Import Plugin, etc
Can anyone guide me how to go about it ? Which plugins will be useful ? Any example or tutorial somewhere will be useful. The configuration of build pipeline plugin on jenkins was not seamless for me.
Thanks,
Bhargav
I would work it this way :
Install jenkins on your first server
Install the following plugins : ssh credentials, ssh slaves, copy to
slave, and restart jenkins
Go to Manage jenkins -> Manage credentials, and add ssh credentials
for your second server
Go to Manage jenkins -> Manage nodes, and create a passive slave.
The launch method should be "Launch slave agents on Unix machines
via ssh". You should use the credentials that you have added in step
3
Create a job to build your code. In the advanded options of job, you
should indicate that the job must only be built on master node.
Create a job to deploy your code on the second server. In the
avanded options of job, you should indicate that the job must only
be built on slave node.
In the "Build Environment" section, check the "Copy files into workspace before building" box and configure what files you want to copy from first server (https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin)
The code will be copied into the jenkins slave's workspace.

Build a project remotely but pick the code from local machine through Jenkins

I'm running jenkins on my local machine. I need to build and run a project on remote machine as a slave.
I have my project(Java code) in my local machine where the Jenkins is running. So Now when I build the project it looks for the code in my slave machine and says it's not able to find the build.xml in my slave machine.
I want to be able to have Jenkins looks for the code in my local machine and build it in my slave machine and run in the slave machine.
Is that possible? if yes pls help me.
You do not state which version control system you are using? Jenkins has version control plugins for Git, Subversion, etc...
The idea is that you commit and push your changes to your source code repository and the Jenkins slave will automatically pull down the code and compile if anything has changed.
Try the copy artifact plugin. You can create 2 jobs - 1st one to just check out the source code from your repo/version control/workspace. The second job (which runs on the slave restrict where this job can be run inside the job config) can copy those files automatically to the ...remote slave/workspace and then you do whatever you want with them.
This will do what you want, but as Mark O'Çonnor mentions, the idea is you commit the changes to your repository and then the other machine checks it out.

Resources