Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

jenkins parameterised shell script

Posted on 2013-05-23
3
Medium Priority
?
4,493 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:worm-getter
ID: 39193786
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
ID: 39199866
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
ID: 39212596
This was tried and tested and we got good results.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

604 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