I am trying to run a shell script through jenkins pipeline. When I run it manually it works fine. But in same machine when I am execute it through jenkins file it is failing.
Jenkins file :-
if ("${BRANCH_NAME}".startsWith("users"))
{
node ('linux')
{
stage('run groovy script')
{
stdout = sh(script: '"$MyWorkSpaceLinux/planning/build/jdocgroovy.sh" ${BUILD_NUMBER}', returnStdout : true)
println("running groovy stdout################ " + stdout + " ####################")
}
}
}
Below is the error:
javadoc: error - cannot read jdocgroovyfiles_ux.dat (No such file or directory)
cp: cannot stat `groovy-examples.html': No such file or directory
Emptying out Javadoc folder
Generatig Javadoc files
Below is the shell script:-
export PLANNING_HOME=/scratch/pqsharma/jenkins/workspace/Planning_develop/planning/HspJS
export JDK_HOME=/usr/lib/jvm/java-1.8.0-openjdk.x86_64/
build_no=${1}
echo Emptying out Javadoc folder
mkdir "/net/slcnas502.us.oracle.com/export/EPM_Planning/PlanningDev/Buzz/tmp_pre_rel/Planning/builds/develop/${build_no}/src/javadocgroovy"
echo Generatig Javadoc files
"${JDK_HOME}/bin/javadoc" -classpath ${PLANNING_HOME}/lib/Jersey/jersey-core.jar -sourcepath "${PLANNING_HOME}/src" -windowtitle "Oracle Enterprise Performance Management Cloud, Groovy Rules" -header "Oracle Enterprise Performance Management Cloud, Groovy Rules Java API Reference" -bottom "Copyright © 2017, 2020, Oracle and/or its affiliates. All rights reserved." -overview groovy-overview.html -public -nodeprecated -d "/net/slcnas502.us.oracle.com/export/EPM_Planning/PlanningDev/Buzz/tmp_pre_rel/Planning/builds/develop/${build_no}/src/javadocgroovy" @jdocgroovyfiles_ux.dat
cp groovy-examples.html "/net/slcnas502.us.oracle.com/export/EPM_Planning/PlanningDev/Buzz/tmp_pre_rel/Planning/builds/develop/${build_no}/src/javadocgroovy"
Someone kindly help me to understand why am I not able to execute it through jenkins file