簡體   English   中英

使用 Windows 在 Jenkins 管道中運行 Python 腳本

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM