Skip to main content

Command Palette

Search for a command to run...

I have a build_cmake.bat file, anyway to propagate errors and build failure to my jenkinsfile?

Updated
1 min read

For a while now our build showed as passing but it was actually failing

Any way to integrate bat files to propagate errors and failures to jenkinsfile?

My simple script for reference

@echo off

cd .\app\Service\
cmake --build --preset=build-x86-release
cd ..\..\

pause

in jenkinsfile I have:

//Stage 16: Start build
                    stage('Build') {
                        if (env.BUILD_CONFIGURATION == 'win64_release') {
                            cmd_from_file('cmake-build-x64')
                        } else if (env.BUILD_CONFIGURATION == 'win32_release') {
                            cmd_from_file('cmake-build-x86')
                        } else {
                            error "Unknown BUILD_CONFIGURATION: ${env.BUILD_CONFIGURATION}"
                        }
                    }

More from this blog

SRE Tribe

413 posts