【发布时间】:2021-05-18 20:37:18
【问题描述】:
我有一个 Jenkinsfile,它使用共享的 Jenkins 库并调用下面定义的 groovy 文件中的方法。
shared-jenkins-lib
|
|-----------vars
| |-------pipeline_script.groovy
|
|-----------scripts
|-------test_script.groovy
这是库的结构,pipeline_script.groovy 有一个方法 test 从 jenkinsfile 调用。
def test(){
dockerArgs = "--entrypoint /bin/bash"
dockerCommand = "`../scripts/test_script.sh`"
dockerOut = sh (script: "docker run ${dockerArgs} ${image} ${dockerCommand}", returnStatus: true)
}
我参考了test_script.sh,但似乎在该位置找不到文件。
我在 docker 中运行 jenkins。引用脚本的正确方法是什么
【问题讨论】:
标签: docker jenkins jenkins-pipeline