0

I have a shell script at Unix Server which contain sqlplus commands to do some validation.and I can run script using putty and see required result.In Unix server I have set up Oracle path and Library path in .bash_profile file. So when I start putty , it get loaded and can understand sqlplus command.

Now Challenge is

when I call that shell script from Jenkins(Windows node) then I get error "sqlplus command not found". Here I call .bash_profile file first then my shell script which have sqlplus commands.

Please help.

5
  • Do you use something like cygwin on windows? If not you can call your bash_profile whatever you want, but it is not going to source your commands. Add the location of the binaries to your windows Path as well Commented Dec 29, 2016 at 19:24
  • Windows machine is at some remote location and it keep changing as per availability... Commented Jan 2, 2017 at 8:24
  • Thanks Rik... Could you please suggest Commented Jan 4, 2017 at 9:24
  • First of all, the binary needs to be on the windows node as well. Then you can either run it from its abolute path C:\path\to\sqlplus\on\windows\node, or if you use powershell to run the commands, see this post or from bat, see this post. If it is a freestyle job, you can put it in the code area as well. Start with SET PATH=%PATH%;c:\path\to\sqlplus\on\windows\node Commented Jan 4, 2017 at 9:35
  • Additionally you can coinfigure the windows node "Manage Jenkins -> Manage Nodes -> 'Windows node' -> Configure - > Node properties" And add the path there Commented Jan 4, 2017 at 9:38

1 Answer 1

0

Set up the PATH as an environment variable in your Jenkins job definition. More details here:

How to set up environment variables in Jenkins

Sign up to request clarification or add additional context in comments.

1 Comment

I have setup env variable in jenkins jobs which I used in my bash_profile (Path,Librarypath)..still getting error "sqlplus command not found".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.