我正在运行一个 Jenkins 管道,我有一个烧瓶应用程序要运行然后测试(使用鼻子)
我正在使用的当前 Jenkinsfile 是
pipeline {
agent { docker { image 'python:3.8.0' } }
stages {
stage('build') {
steps {
withEnv(["HOME=${env.WORKSPACE}"]) {
sh 'python --version'
sh 'python -m pip install --upgrade pip'
sh 'pip install --user -r requirements.txt'
sh script:'''
#!/bin/bash
echo "This is start $(pwd)"
cd ./flask/section5
echo "This is $(pwd)"
python create_table.py
python myapp.py &
nose2
'''
}
}
}
}
}
Jenkins 创建 docker 镜像并下载 pythnon 要求。从shell脚本运行nose2时出现错误
有这个错误
+ pwd
+ echo This is start .jenkins/workspace/myflaskapptest_master
This is start .jenkins/workspace/myflaskapptest_master
+ cd ./flask/section5
+ pwd
+ echo This is .jenkins/workspace/myflaskapptest_master/flask/section5
This is .jenkins/workspace/myflaskapptest_master/flask/section5
+ python create_table.py
DONE
+ nose2+
python myapp.py
.jenkins/workspace/myflaskapptest_master@tmp/durable-1518e85e/script.sh: 8: .jenkins/workspace/myflaskapptest_master@tmp/durable-1518e85e/script.sh: nose2: not found
我错过了什么?