script.sh: line 1: ./gradlew: No such file or directory on Jenkins

前端 未结 2 1537
半阙折子戏
半阙折子戏 2021-01-16 16:16

This is error message I got

./gradlew clean assembleRelease /Users/bhanukaisuru/.jenkins/workspace/OrelGo@tmp/durable-b74adbad/script.sh: line 1:

2条回答
  •  攒了一身酷
    2021-01-16 16:39

    You do not need to specify the Jenkins workspace with the commands sh and bat if you want to execute a command on the root level of it.

    sh 'mkdir test' would create a folder in /test for example.

    If gradlew is located on the root of the Jenkins workspace the following should be sufficent:

    sh "gradlew clean assembleRelease"
    

    otherwise a full path works as well.

提交回复
热议问题