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

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.

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

How to place an artifact in a remote server and unzip

Hi have requirement to Continous deployment using Jenkins and below are the steps to achieve.
1.Jenkins job download the artifact from Nexus and place it in a remote server
2.Unzip the artifact present in the remote server.
3.Perform Gradle task in remote server
You could try using Ansible maybe https://docs.ansible.com/ansible/latest/modules/copy_module.html
If it is Windows:
https://docs.ansible.com/ansible/latest/modules/win_unzip_module.html
You have modules for every situation:
https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
You could do it with Jenkins, scripting the code, and probably storing the login in the Jenkins credentials.

Execute cmd file on windows deployment server from Jenkins linux server

We have one Jenkins master (Linux) and one Jenkins slave (windows). We are working on .NET Web application.
Initially our deployment was to prepare the artifacts through TeamCity and invoke a cmd file manually in the deployment server and the deployment happens. The cmd file invoke nant internally and deploy the all required things.
Now we are using Jenkins to implement the CI/CD pipeline.
We have been able to successfully prepare the artifacts and also copied the artifacts to the deployment server through Jenkins. Build and artifact preparation are happening at Jenkins slave.
Pending is , we just need to execute the "cmd" file in the deployment server.
Can anyone please guide me, how to execute the "cmd" file in the deployment server from Jenkins ?
We are using Freestyle project in jenkins.
First install & configure a Jenkins agent on the deployment server(install, configure)
After selecting your build node:
Open the dropdown in the build section and click on Execute Windows Batch Command:
After selecting the option, a box will appear to enter the commands.

Jenkins upload slave build to a server from master

Jenkins is running in a windows machine.
Slave is a mac building iPhone apps. (using ssh)
This configuration building successfully.
If I archive the artifact (e.g. Output/.) it saves in the master (windows machine).
But when I try to run any bat command to copy files in the post build steps, it runs in the slave machine.
How can I run command in the master (Windows), in the post build steps? Or there is other ways to do it?
I want to upload the build artifact to a server accessible only from the windows (master) machine. How can I do that?
How to tell Jenkins, to take the build artifacts from the slave and run some command (copy files) on those files in the master.
Use the Publish Over FTP Plugin. Create an ftp in master and using Publish Over FTP Plugin, copy the build artifacts to master machine.
Thanks,
Manu

is it possible to stop manually dev server from 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"

Resources