Solved

jenkins parameterised shell script

Posted on 2013-05-23
3
3,459 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 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