Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

asked on

Execute hudson/jenkins job using script multiple times

Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Jenkins is so variable tool and it also has so many plugins that you can do each job in many possible ways...

No need to post links describing Jenkins but please rather define what means "to execute a script with different parameters multiple times".  What parameters, what multiplicity?

Jenkins allows to define several job triggers and these jobs can consist of various tasks like DOS/Windows batch, PowerShell script, any EXE etc. etc. All these tasks can read parameters from several places like disk files, OS environment variables, Subversion, Git etc.

You don't need Groovy to execute some job multiple times. You may simply write a DOS batch having a loop inside and/or reading parameters from a file. PowerShell script is better to achieve your goals because it is powerfull language which can do almost everything you need on your PC.

PowerShell is installed on each Windows PC.

BTW, do you really need Jenkins?  Windows scheduler could do the same job for you.

Of course, as you did not disclose your OS environment above answer is expecting Windows...  Nothing against Groovy :-)
Avatar of enthuguy

ASKER

sorry, we are using jenkins, So would like to find a way

thanks
I know you are using Jenkins... and the way definitely exists in Jenkins.

You may use Windows batch, PowerShell, any other EXE written is any language, probably Groovy etc.

But I still don't know what parameters would you like to change and what multiplicity is used. Are you able to install Jenkins plugins? What operating system do you use?
Thanks,
yes, we can install plugin and we are on Linux
So Linux... That means you cannot define DOS/Windows batches and PowerShell scripts... Microsoft released some PowerShell DSC for Linux but I am not sure whether it is usable under Linux Jenkins or not.  Linux has its own equivalents like shell scripts etc. and it seems Groovy is OK for this task.

Start with a simple script and extend it later.

Another option is to overview the list of Jenkins plugins and check whether some of them fits to your needs.
ASKER CERTIFIED SOLUTION
Avatar of enthuguy
enthuguy
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
worked