deploy artifacts to remote VM from Jenkins - jenkins

I am trying to automate deployment proceeses using Jenkins. I am trying to deploy some config files and some EAR files to remote VM. Normally I would open a Remote Desktop connection and deploy manually.
Is there a way FROM JENKINS through scripting or plugin where I can deploy files to a remote VM?

You can use this framework which automates the management and deployment of files on remote VM's running in a VMWare environment.
Just install RI on your Jenkins server and add batch steps to execute the RI executable with a XML configuration that should do what you want.

Related

Where should I configure the jobs to build the project and to deploy it?

I am very new to devops and I could really use some help to understand the concept of this.
So I am trying to develop a continuous integration environment using VirtualBox and Vagrant. I've read some examples of how to build such an environment to pull a maven project from github, build it and deploy to the nexus artefact repository.
I have managed to configure a VM with Ubuntu and installed Tomcat on it.
What I don't understand is where should I configure the Jenkins jobs to build the project and to deploy it to nexus and to make it run in Tomcat Server. On my local machine or in the virtual machine ?
Thanks.
If you are using bridged/hostonly networking for ubuntu, then you can run the jenkins in your host machine. If it is NAT/Private networking, use guest machine to run jenkin jobs.

How to deploy liferay7 portlet to remote server by jenkins?

We have a Liferay7 project and need to deploy project to remote server by jenkins. I did the following items:
Jenkins installed
Checkout from git repository
Build with Gradle 3.0
After that i need to deploy jar files to X.X.X.X server. What is the best practices for that? Should i deploy project with Ant or Gradle?

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.

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

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