is it possible to stop manually dev server from jenkins - jenkins

my dev server is installed in jboss aplication server(linux). is it possible to stop manually dev server from jenkins. whenever developer wants depolyment at that time only i have to stop server and deploy artifacts in to dev server.All these operations is possible from jenkins.i already have scripts to stop and start the server. But i dont know how to configure in jenkins.

If your jenkins is also on linux, use "Execute shell" build step and in there connect to your server and execute command:
For example:
ssh user#server "remote_script_command"

Related

How to deploy a jar on Windows server through Jenkins job?

We have a jenkins job which is getting triggered after every push to gitlab.
It creates a build. Upon successful build we want to copy the jar to some Windows server.
We are able to set SSH credentials for Linux server. How do we do it for Windows server.
Thanks
Install the slave on windows machine & trigger the .bat file through jenkine's job.

Install Applications like Java,tomcat,etc. and after that build an app using jenkins and then deploy on a remote server

When i get an empty Ubuntu server like 172.22... I want to install java ,download Apache-tomcat and install. After that build my appliaction and deploy it on the server. I have used Publish Over SSH Plugin to transfer some scripts to run when it on server but the problem is it only takes scripts from the application space where it is build.For that it this initial setup scripts must also be present inside every application i build.
In ideal scenario I want one job to setup a server by installing applications like java , tomcat.. etc. in remote server and then one job to build an application and deploy it on that remote server.Can't we do this using Jenkins ?
Possible sollution of deploy:
On jenkins server install plugin to execute Shell scripts. That allow us to run Curl command. To deploy .war on remote server use command with curl, example:
curl -T /var/lib/jenkins/jobs/(Path to war ) http://user:password#ip:port/manager/text/deploy?path=/(nameOfWar)&update=true
Also add role manager-script to Your tomcat user.
For deploy on linux servers i use plugin Deploy war/ear to a container. So it's all in Jenkins and Tomcat.
In case doing a remote install from one job i preffer to use ssh plugin, even better sollution is to write a perl script put it on server then run it. To run ssh command by perl for example use: $tomcat = apt get install tomcat; etc.

Unable to schedule job in VM using Jenkins

I am scheduling QTP scripts using Jenkins, intended to run on weekends. The QTP scripts are in the same Jenkins machines.
The build is not triggered at the scheduled time instead it triggers only when I login to the VM as it seems so.
Configuration:
OS : Windows 7 Ultimate
Jenkins version: 1.620 (master only)
When I do build manually, it works. Only the scheduling is not working.
If you are running Jenkins Slave as a service, you have to make sure that it runs as administrator in services.msc in the Log On tab. Make sure to restart the service after you add the Admin Account.
Cheers!

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

Resources