Jenkins Batch to Bash

26 views
Skip to first unread message

Cornelius Ele

unread,
Nov 23, 2018, 9:51:55 AM11/23/18
to Jenkins Users
Hello all,

I am trying to migrate a Jenkins instance from a Windows machine to a Linux server. Upon doing a quick *.bat search in the C:\Program Files (x86)\Jenkins folder, I see 238 batch files. 
Do these batch files need to be converted for the new Jenkins instance to perform all its jobs? If so, how can the conversion be done? 

Appreciate any kind of feedback.

Simon Richter

unread,
Nov 23, 2018, 10:39:38 AM11/23/18
to jenkins...@googlegroups.com
Hi,

On 23.11.18 15:14, Cornelius Ele wrote:

> Do these batch files need to be converted for the new Jenkins instance
> to perform all its jobs? If so, how can the conversion be done? 

The only things that need to be converted are "batch" build steps in
existing jobs if the job is no longer going to be executed on a Windows
agent.

The main Jenkins installation is independent from the agents (and the
executors on the master node behave like an agent, for the most part).

So a Jenkins installation on a Linux system will be able to configure
batch build steps, but not execute them.

Simon

RAJENDRA PRASAD

unread,
Nov 26, 2018, 3:02:45 AM11/26/18
to jenkins...@googlegroups.com
Hi Ele,

You dont need to cover ant scripts:

Here is the Jenkins migration Steps from Windows to Linux:

On Windows Machine Perform Following Activities
1. First find out the Plugins Installed on windows Jenkins setup 
2. Find out Tools like (maven,ant,jdk ..etc) installed on windows Jenkins server (You can find these on jenkins global tool configuration)
3. Then Stop Jenkins and Copy all jobs files from Windows Jenkins Server:
        <Jenkins_home>/jobs Folder
          How to Find Jenkins Home Folder:
          Login to Jenkins
         Manage Jenkins
         System Configuration
         Click the first "advanced" button            here you can find Jenkins_home path

Then Perform Follwoing Activites on New Linux Jenkins Server;
1. Install Jenkins on Linux Server nearest version that you installed on Windows
2. Install the plugs that you have on windows Jenkins server
3. Install the all tools that you had on windows Jenkins server
4. Stop Jenkins Server
5. Copy the all the jobs to in to Linux JENKINS_HOME folder
6. Start Jenkins Server
7. Go to Manage Jenkins Server
8. Click on "Reload Configuration from Disk" link
9. Allow Jenkins relaod  takes 10-20 seocds will take
10. Re login and check your jobs , All must be there
wait wait Still porting is not completed.
11 On Linux Each yob you might be running as Batch command
12. Now you must change it  Shell to run.
 
image.png
  
 13 . And off course you need  port changes if you are using any native batch scripts and need to convert into Bash Scripting.

Let me know if you need any help


Thanks and Regards,
Rajendra Prasad Reddy Penumalli
Sr. Engineer in Testing.
Mobile:9008566233


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/01fc6bc7-f058-4488-bc28-e13ac01d789d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cornelius Ele

unread,
Nov 27, 2018, 1:37:53 PM11/27/18
to Jenkins Users
Thank you for such a detailed reply!

Just wondering, because there are many plugins and tools, and I want to maintain the same version as the old Jenkins, would it be possible to copy the 'plugins' and 'tools' folder as well? 
I was originally thinking of copying everything under JENKINS_HOME from Windows to Linux and configure each of the local references (i.e. JDK) accordingly.

Thanks,
Ele
Reply all
Reply to author
Forward
0 new messages