I have A Jenkins Server and 3 Agents. Builder, Programmer, and Tester. The three agents are pretty self explanatory. The Builder builds a Yocto image and saves the output files. The Programmer takes the saved image files and places them onto a device under test. The Tester then runs a suite of automated tests against the new image files.
If my Builder's Yocto stage is complete I would like it to kick off a pipeline on the Programmer agent. I am having a hard time finding an example of this. I assume it would be something similar to this:
pipeline {
agent {
label 'YoctoBuildNode'
}
stage('Yocto') {
steps {
script {
if (isStagingOrMaster()) {
echo "Performing a full Yocto build for Staging!"
sh "chown -R $USER:$USER ${env.WORKSPACE}"
sh "chmod -R a+rwx ${env.WORKSPACE}"
sh "${env.WORKSPACE}/jenkins_quick_start.sh"
} else {
echo "Building the main Application for branch ${env.BRANCH_NAME}"
buildProject()
}
}
}
}
stage('Doxygen') {
}
state('Trigger Programmer') {
agent {
label 'ProgramNode'
}
Not sure what to do here
}
There is an example here, specifically second example in this section.
In short, you declare top-level
agent none, and then declare appropriateagenton every step of your build.Something like this: