sh '$WORKSPACE/script.sh' solved the problem.
On Tuesday, June 6, 2023 at 4:17:12 PM UTC+5:30 Mk wrote:
> I'm using Jenkins - 2.375.2 and both Jenkinsfile and script.sh files are
> in my github repository.
>
> My Jenkinsfile (Declarative Pipeline) content as follows,
> pipeline {
> agent any
>
> stages {
> stage('Checkout') {
> steps {
> git url: '[email protected]:org/repository.git'
> }
> }
>
> stage('Script') {
> steps {
> sh 'script.sh'
> }
> }
> }
>
> Any idea why my job goes to below path and looking for script?
> + myscript.sh
> /home/user/jenkins/workspace/My_JOB_1@tmp/durable-942e10b9/script.sh: 1:
> /home/user/jenkins/workspace/My_JOB_1@tmp/durable-942e10b9/script.sh:
> myscript.sh: not found
>
> I have my script inside this path /home/user/jenkins/workspace/My_JOB_1
> path.
> Not sure why it has created jobname with @tmp and looking script in that
> path.
>
> Any advise to fix this problem would be helpful.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/7b51799a-6452-4e4b-9766-af5ae9ce7043n%40googlegroups.com.