how to execute .csx file (dotnet scirpt) in jenkins

31 views Asked by At

i try to build a unity project throught jenkins pipeline by dotnet script, but i don't know how to run .csx file , i have search for it on google, and find this:https://groups.google.com/g/scriptcs/c/MvHVR4054tQ/m/2Zuq5dv7_DIJ , but it can't run. i also try to ask chatgpt to find the way out, like: `pipeline { agent any

stages {
    stage('Execute Dotnet Script') {
        steps {
            script {
                def scriptFilePath = "/path/to/your/script.csx" // 
                sh "dotnet script $scriptFilePath"
            }
        }
    }
}

} ` or like this:

#!/bin/bash

dotnet script /path/to/your/script.csx

pipeline {
    agent any

    stages {
        stage('Execute Shell Script') {
            steps {
                sh "./path/to/your/shell_script.sh" // 
            }
        }
    }
}


all of these can't work

i hope there's a good way to execute .csx file in jenkins.

0

There are 0 answers