Is there a way to have a job to be built automatically while picking a variable for the microservice that needs to be built..
I want Jenkins to deploy automatically depending on the folder that was changed in the Git repository.. But this does not seem to work.. Do you guys have any idea ?
for example, i tried:
”
pipeline {
agent any
stages {
stage(‘Build’) {
steps {
echo ‘Starting build ms service .’
}
}
stage('microservice1') {
when { changeset "*/microservice1/**"}
steps {
echo "====microservice1===="
build job: '/APP/Microservices/Microservice_Integ/develop', parameters: [[$class: 'StringParameterValue', name: 'appName', value: 'microservice1']], wait: false, propagate: false
}
}
stage('microservice2') {
when { changeset "*/microservice2/**"}
steps {
echo "====microservice2===="
build job: '/APP/Microservices/Microservice_Integ/develop', parameters: [[$class: 'StringParameterValue', name: 'appName', value: 'microservice2']], wait: false, propagate: false
}
}
}
}
”
I was expecting for Jenkins to detect the folder that was changed in Git and then build the microservice corresponding to that folder..
Achraf Azouagh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.