Solved

jenkins parameterised shell script

Posted on 2013-05-23
3
3,237 Views
Last Modified: 2013-06-01
I want to execute shell script not shell command as:-
<Script name> [branches] [releaseName] [buildName]

How can I execute this shell scripts with parameter on jenkins?
0
Comment
Question by:jgdvishnu
  • 2
3 Comments
 
LVL 6

Expert Comment

by:worm-getter
Comment Utility
maybe this link might help you:

https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

good luck.
0
 

Accepted Solution

by:
jgdvishnu earned 0 total points
Comment Utility
2 issues was faced:-
 a) where to put the shell script file on the jenkins server and how will Jenkins refer to that file

b) how will Jenkins server know that the given text is shell script and not a shell command.

Passing parameterized commands and parameterized flie using the below link was not helpful as user has to type in values manually and there are lot of chances that end user may enter incorrect or bizarre values and would need validations.
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

Best approach was to enter below command in the Execute shell command text area -

exec <Script name>  [branches] [releaseName] [buildName]

Open in new window

some how the parameter got passed by the above suggested method by: "worm-getter" and it might be a way to pass input parameter however it is not recommended as it is error prone and also the uploaded shell file script file got uploaded successfully when prompted to run the job and got downloaded on running the job however they did not execute so I do not recommend that approach.
0
 

Author Closing Comment

by:jgdvishnu
Comment Utility
This was tried and tested and we got good results.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now