[英]Run a Python script in Jenkins Pipeline using Windows
我沒有找到 Windows 的解決方案:這僅適用於 Linux:
如何在 Jenkins 文件(管道)中調用 py 腳本?
pipeline {
agent { docker { image 'python:3.8.1' } }
stages {
stage('build') {
steps {
sh 'python --version'
}
}
}
}
如您所知,sh 命令讓您調用 Linux shell。
要在 Windows 上執行 Python 腳本,您應該執行以下步驟:
steps {
bat 'python --version'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.