From edfdc0080724f5ddb6b13b214714d98dcf1a695e Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Sat, 3 May 2025 13:52:58 +0300 Subject: [PATCH] updating and testing BuildDependencies Jenkins pipeline file --- build/jenkins/BuildDependencies | 3 +- build/jenkins/ImageMatcher | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 build/jenkins/ImageMatcher diff --git a/build/jenkins/BuildDependencies b/build/jenkins/BuildDependencies index 542e180..11c6634 100644 --- a/build/jenkins/BuildDependencies +++ b/build/jenkins/BuildDependencies @@ -66,8 +66,7 @@ pipeline { success { echo 'Dependencies installed successfully. Triggering ImageMatcher Build pipeline...' // Trigger the ImageMatcher Build pipeline job upon success - // Replace 'ImageMatcher Build' with the exact name of your ImageMatcher Jenkins job - build job: 'ImageMatcher Build', + build job: 'ImageMatcher', wait: false // Set to true if you want Dependencies to wait for ImageMatcher to finish // No parameters are passed by default, add if needed } diff --git a/build/jenkins/ImageMatcher b/build/jenkins/ImageMatcher new file mode 100644 index 0000000..df8f274 --- /dev/null +++ b/build/jenkins/ImageMatcher @@ -0,0 +1,68 @@ +// 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 + // Explicitly set the workspace to the shared BuildDependencies workspace + // This ensures the ImageMatcher build occurs within the same directory structure + // where dependencies were installed and Azaion Suite code resides. + // Adjust this path if needed + workspace 'C:/Jenkins/workspace/BuildDependencies' // **Updated workspace path** + } + + 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 + } + + stages { + // Removed: stage('Checkout ImageMatcher Code') - Code is checked out by Dependencies pipeline + + stage('Build ImageMatcher') { + steps { + echo 'Building ImageMatcher...' + // Add steps here to build the ImageMatcher project + // This might involve compiling code, running build scripts, etc. + // Based on your original script, this likely involves running a build.cmd + // The code is expected to be in the 'gps-denied' subdirectory due to the Dependencies pipeline checkout + //dir('gps-denied\\image-matcher') { // Change directory to the ImageMatcher build location + // 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...' + // archiveArtifacts artifacts: 'path/to/imagematcher/build/output/**' // Adjust path + // } + // } + } + + 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 + } +}