You may also want to verify that the HOME environment variable is set, it may not be set the way that the jenkins agent is run.
On Wed, Nov 25, 2020 at 8:10 AM zil...@gmail.com <zill...@gmail.com> wrote: > I don't know what your script does, but a war file expects files in > certain directories. Put a pwd statement right before you run the script > to ensure it's where you expect it to run. If not cd to that directory. > Example > > $ pwd > $ cd $WORKSPACE > $ sudo source "$HOME/.sdkman/bin/sdkman-init.sh" > > On Wednesday, November 25, 2020 at 10:02:13 AM UTC-5 jibs...@gmail.com > wrote: > >> Yes brother but it accept the command but do nothing >> >> El mié, 25 nov 2020 a las 9:43, zil...@gmail.com (<zil...@gmail.com>) >> escribió: >> >>> Have you tried >>> >>> $ sudo source "$HOME/.sdkman/bin/sdkman-init.sh" >>> >>> >>> On Monday, November 23, 2020 at 1:54:23 PM UTC-5 jibs...@gmail.com >>> wrote: >>> >>>> >>>> Hello every one, I'm trying o build a .war file using Grails. For this >>>> I already Installed Grails on my Jenkins Node and on the way I did it, >>>> before start using Grails commands form build the War, I have to set the >>>> source of the Grails Commands. I have to do: >>>> >>>> $ source "$HOME/.sdkman/bin/sdkman-init.sh" >>>> >>>> If I run this as "root" or even "jenkins" user, it work perfectely but >>>> on the Job I set it in a "Shell" and I got the following error. >>>> >>>> Running as SYSTEM Building in workspace >>>> /var/lib/jenkins/workspace/Build and Deploy Integro Cloud [Build and Deploy >>>> Integro Cloud] $ /usr/local/bin -xe /tmp/jenkins762672155125796765.sh >>>> FATAL: command execution failed java.io.IOException: error=13, Permission >>>> denied at java.lang.UNIXProcess.forkAndExec(Native Method) at >>>> java.lang.UNIXProcess.<init>(UNIXProcess.java:247) at >>>> java.lang.ProcessImpl.start(ProcessImpl.java:134) at >>>> java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) Caused: >>>> java.io.IOException: Cannot run program "/usr/local/bin" (in directory >>>> "/var/lib/jenkins/workspace/Build and Deploy Integro Cloud"): error=13, >>>> Permission denied at >>>> java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at >>>> hudson.Proc$LocalProc.<init>(Proc.java:250) at >>>> hudson.Proc$LocalProc.<init>(Proc.java:219) at >>>> hudson.Launcher$LocalLauncher.launch(Launcher.java:937) at >>>> hudson.Launcher$ProcStarter.start(Launcher.java:455) at >>>> hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109) at >>>> hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) at >>>> hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at >>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) >>>> at hudson.model.Build$BuildExecution.build(Build.java:206) at >>>> hudson.model.Build$BuildExecution.doRun(Build.java:163) at >>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) >>>> at hudson.model.Run.execute(Run.java:1853) at >>>> hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at >>>> hudson.model.ResourceController.execute(ResourceController.java:97) at >>>> hudson.model.Executor.run(Executor.java:427) Build step 'Execute shell' >>>> marked build as failure Finished: FAILURE >>>> >>>> Please any help will be well received. >>>> >>>> Greetings, >>>> >>>> Eng. Jibsan >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Jenkins Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to jenkinsci-use...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jenkinsci-users/a1d32df4-bca2-4c52-aa65-631d53e8347cn%40googlegroups.com >>> <https://groups.google.com/d/msgid/jenkinsci-users/a1d32df4-bca2-4c52-aa65-631d53e8347cn%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/09ae1d68-5b0e-4adc-8e46-f52dfb403e3cn%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/09ae1d68-5b0e-4adc-8e46-f52dfb403e3cn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Website: http://earl-of-code.com -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVdkt54G4DH4WQ1Pd3VmCeG83beB-6EnGQMy_h1GEiiA%2BQ%40mail.gmail.com.