// Jenkinsfile for ImageMatcher Build pipeline pipeline { // Ensure this runs on your Windows agent agent { label 'Win10-BuildMachine' // Specify the agent label type and value directly // Removed: workspace 'C:/Jenkins/workspace/BuildDependencies' // We will use a dir() step within the stage's steps block instead. } tools { // Define any tools needed specifically for building ImageMatcher // git 'Default' // Git is NOT needed for checkout in this pipeline // dotnetsdk 'dotnet-sdk' // If ImageMatcher is a .NET project } environment { // Define environment variables specific to ImageMatcher // REPO_GPS_DENIED_URL = 'git@github.com:azaion/gps-denied.git' // Not needed for checkout // Add any other environment variables needed for the build (e.g., build configuration) CONFIGURATION = 'Release' // Example build configuration // Define the path to the shared workspace SHARED_WORKSPACE = 'C:/Jenkins/workspace/Azaion' // Define shared workspace path } stages { stage('Build ImageMatcher') { steps { echo "Building ImageMatcher in shared workspace: ${env.SHARED_WORKSPACE}" // Use a dir() step to ensure the build command runs in the shared workspace dir(env.SHARED_WORKSPACE) { // The code is expected to be in the 'gps-denied' subdirectory relative to the shared workspace dir('gps-denied\\image-matcher') { // Change directory to the ImageMatcher build location relative to SHARED_WORKSPACE bat 'build.cmd' // Replace with the actual build command } } } } // Optional: Archive ImageMatcher build artifacts if needed by Azaion Build // stage('Archive ImageMatcher Artifacts') { // steps { // echo 'Archiving ImageMatcher artifacts...' // // Path is relative to the current directory (which will be SHARED_WORKSPACE due to the outer dir) // dir(env.SHARED_WORKSPACE) { // Ensure this also runs in the shared workspace // archiveArtifacts artifacts: 'path/to/imagematcher/build/output/**' // Adjust path relative to SHARED_WORKSPACE // } // } // } } post { success { echo 'ImageMatcher built successfully. Triggering Azaion Build pipeline...' // Trigger the Azaion Build pipeline job upon success // Replace 'Azaion Build' with the exact name of your Azaion Build Jenkins job build job: 'Azaion Build', wait: false // Set to true if you want ImageMatcher Build to wait for Azaion Build to finish // You might pass parameters here if Azaion Build needs info from ImageMatcher // Example: parameters: [ string(name: 'IMAGEMATCHER_BUILD_NUMBER', value: env.BUILD_NUMBER) ] // If Azaion Build needs ImageMatcher artifacts, it will use copyArtifacts. } failure { echo 'ImageMatcher build failed. Azaion Build pipeline will NOT be triggered.' // Optional: Add other actions for failure, like sending notifications } // Optional: Add always, unstable, etc. blocks if needed } }