Files
annotations/build/jenkins/ImageMatcher
T
2025-05-03 15:09:28 +03:00

69 lines
3.3 KiB
Plaintext

// 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
echo "Running ImageMatcher dependency installation script..."
// Run the install_dependencies_win script located in the gps-denied subdirectory
// Use bat as it's a Windows script
bat 'gps-denied\\install_dependencies_win.cmd' // **Added step to run dependency script**
echo "ImageMatcher dependency installation script finished."
echo "Running ImageMatcher build command..."
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
}
echo "ImageMatcher build command finished."
}
}
}
}
post {
success {
echo 'ImageMatcher built successfully. Triggering Azaion Build pipeline...'
// Trigger the Azaion Build pipeline job upon success
// Replace 'AzaionBuild' with the exact name of your Azaion Build Jenkins job
build job: 'AzaionBuild',
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
}
}