Jenkins Master on Linux to trigger PowerShell script on windows slave - jenkins

I have a Linux server where I have installed Jenkins and I have a windows slave server too. Just wanted to know is it possible to run powershell task from windows slave as we have Jenkins installed on Linux server? Or do I need to make a windows master to run all these powershell tasks?

This is possible. Make sure that you select the appropriate slave (using label expressions) to execute the job.

Related

Jenkins ssh from Linux server to a Windows node

Linux is the operating system for my Jenkins server. How to configure a job to run a .bat script on a windows node? Is this even possible to go cross platform like that?
We have Ubuntu Jenkins server that runs jobs on Windows slave nodes. We had a Windows Jenkins server and we use the same jobs, without modification, running on the Ubuntu master. Maybe this or this link could be helpful.
We connect Windows nodes to the Ubuntu master the same way we connected them to the Windows master. For more info about connecting nodes see this article.

Why Jenkins Slave need java to run slave.jar?

Via SSH slave plugin, we can have Jenkins slave to run specific job, but in my understanding, only SSH is enough to execute commands, why Jenkins still want to run slave.jar(Have to install JAVA)?
SSH is the communication mechanism between the master and slave machines.
The slave still has to run something to listen to the master and to do the actual builds. That Jenkins slave code is written in Java and stored in slave.jar.
So the reason you need Java on the slave machine is because the Jenkins slave software is written in Java. SSH is used by the master to tell the slave to do something.

How to get a Jenkins slave to open a windows server session

I'm trying to get a Jenkins slave to open a session on a windows server.
Basically, What I'm try to achieve is:
Jenkins slave is running as a service on a windows 2003 server. When master calls slave, it will open a desktop session on the server and kick off an .exe that will perform GUI testing
What I have done:
Jenkins node created (Node A). Dumb slave. Remote FS root set to path on Windows 2003 server. ("C:\Jenkins\Node"). Launch method Java Web Start
Slave 'Node A' installed from Jenkins master using Java Web Start on windows 2003 server
Jenkins slave now running as a service on server
Jenkins project created and 'Restrict where this project can be run' is set to 'Node A'
Project windows batch command 'C:\GUITest.exe'
When I build the project in Jenkins I was expecting that the slave would be able to open a session and run C:\GUITest.exe. But, I'm missing something.
Anyone any ideas, or know if it is possible (plugins I may need ??)
Any advise / direction much appreciated.
Looks like you want to run GUI test on windows session. It won't work if you run Jenkins Slave as service, you have to run JNLP agent on your windows server. Also if you want to run in unattended mode, meaning that the windows remote session would be disconnected, you need some other setup as well. Please provide more information on what you are trying to do.
You must ensure that whatever process runs the GUI tests (might be a java / cmd / ssh process if you're connected to Jenkins) is not running on session 0 as it won't have access to Desktop and the Windows UI in general. I was in a similar situation and running the same process as a scheduled task instead of service solved it for me.

Deploying and starting a webdriver test program on a remote windows vm from jenkins server

I have a test program in Java for testing a web app using webdriver. It builds and runs in my local machine just fine.
Now, I need to build it in jenkins, then deploy and run it on a VM running on Windows (e.g. server 2008 R2).
Obviously, the test program doesn't work on jenkins as it needs to open a browser. This cannot be done under system account in Jenkins server. So I need to deploy it to a remote machine and somehow start the test.
I've heard this can be done using ssh for a linux box, but don't know how to do it for a windows VM.
Any idea?
If you have installed jenkins as service then you need to create a JNLP node in order to run your webdriver tests.
Follow the post for creating JNLP node and running your tests on that.
http://qtp-help.blogspot.in/2013/09/setup-webdriver-maven-project-on-jenkins.html

Jenkins building on a remote machine

I can only build my system on a FreeBSD 5 machine.
I am looking and introducing gerrit and Jenkins into my team.
I have setup the server running gerrit and Jenkins both on a Debian machine for now.
What is the standard way of dealing with Jenkins building on a remote server?
The standard way would be to install a Jenkins Slave on the remote server. See https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds
You then setup the job that must be built on a FreeBSD 5 machine, to only only run on that slave/node. This is can be achieved within the job configuration by specifying the FreeBSD machine by name.
If you don't want other Jenkin jobs to run on that FreeBSD machine, you can configure the slave to only run jobs that are tied to it. See step 4 in the JENKINS Step by step guide to setup master and slave machines for the config page that you need to do this.

Resources