I have a pipeline script (pasted below).  When I run it as-is, the windows 
branch "bat" step fails with the error "'cmd' is not recognized as an 
internal or external command". But if I comment out the macos and 
emscripten branches, the windows branch works just fine. Am I doing 
something wrong?

#!groovy


stage "check out"

node {

    deleteDir()
    checkout scm

    stash includes: "**", name: "source"

}


stage "build"

parallel (

    "windows": {

        node ("windows && visualstudio") {
            deleteDir()

            unstash "source"

            def workspace = pwd()

            dir ("build") {
                bat "cmake .. -G \"Visual Studio 14 2015 Win64\" 
-DCMAKE_INSTALL_PREFIX=${workspace}\\install\\windows"
                bat "cmake --build . --target ALL_BUILD --config Release"
            }

            stash includes: "install/**", name: "windowsBinaries"
        }

    },

    "macos": {

        node ("macos && xcode") {
            deleteDir()
            env.PATH = "/usr/local/bin:${env.PATH}"

            unstash "source"

            dir("build") {
                sh "cmake .. -DCMAKE_INSTALL_PREFIX=../install/macos"
                sh "make"
            }

            stash includes: "install/**", name: "macosBinaries"
        }

    },

    "emscripten": {

        node ("emscripten") {
            deleteDir()
            env.PATH = "/usr/local/bin:${env.PATH}"

            unstash "source"

            dir ("build") {
                sh "cmake .. -DCMAKE_INSTALL_PREFIX=../install/emscripten 
-DCMAKE_TOOLCHAIN_FILE=~/emsdk_portable/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake"
                sh "make"
            }

            stash includes: "install/**", name: "emscriptenBinaries"
        }

    }

)


stage "package"

node {
    deleteDir()

    unstash "macosBinaries"
    zip zipFile: "thorcc-external-macos.zip", archive: true, dir: 
"install/macos"

    unstash "emscriptenBinaries"
    zip zipFile: "thorcc-external-emscripten.zip", archive: true, dir: 
"install/emscripten"

    unstash "windowsBinaries"
    zip zipFile: "thorcc-external-windows.zip", archive: true, dir: 
"install/windows"

    try {
        build job: "ThorCC/" + BRANCH_NAME, wait: false
    } catch (error) {
        echo "Skipped building downstream project because branch " + 
BRANCH_NAME + " doesn't exist."
    }

}



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e5244b13-da97-4f78-8f07-8de184ea3049%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to