noggy
noggy

Reputation: 85

Run a Python script in Jenkins Pipeline using Windows

I didn't found a solution for Windows: This is only working for Linux:

How can I call a py script in a Jenkins File (Pipeline)?

pipeline {
    agent { docker { image 'python:3.8.1' } }
    stages {
        stage('build') {
            steps {
                sh 'python --version'
            }
        }
    }
}

Upvotes: 0

Views: 4784

Answers (1)

ef.7309
ef.7309

Reputation: 11

As you know, the sh command let you invoke the Linux shell.

To execute your Python script on Windows, you should have the following step:

steps {
   bat 'python --version'
}

Upvotes: 0

Related Questions