【发布时间】:2021-01-06 17:34:01
【问题描述】:
谁能解释为什么我得到以下错误:+ python unittests.py python:无法打开文件'unittests.py':[Errno 2]没有这样的文件或目录
这是我的詹金斯文件:
pipeline {
agent any
stages {
stage('prepare') {
steps {
git credentialsId: 'git-cred', url: 'https://github.com/nada809/DockerProject.git'
}
}
stage('Test') {
agent {
docker {
image 'python:3.8-slim-buster'
}
}
steps {
sh 'pip install flask && pip install xmlrunner'
dir("app"){
sh 'python unittests.py'}
}
}
}
}
unittests 文件位于 app 文件夹下。 提前致谢。
【问题讨论】:
-
你可以在运行 unittest.py 之前添加一些 bash cmd 来列出 app 下的文件。例如:sh 'pwd && ls- l'
标签: python docker jenkins flask jenkins-pipeline