My system is set up as a Docker Linux PC Master/BeagleBone Linux Slave, connected via USB SSH.
Essentially, I'm trying to do the following:
- Compile code on the master that is taken from a Bitbucket repo.
- Take the compiled binary and transfer it to the BeagleBone (I'm using 'stash' and 'unstash' in my Jenkinsfile to do this)
- Use the binary on the BeagleBone slave to flash another device that is connected to it (the slave, not the master)
When I build from Jenkins, my master clones the repo, builds the code and stashes the binary. However, when I transfer to the 'flash' stage on the slave, it also tries to clone the repo (which fails due to credential problems - that's a separate issue). I don't want it to do this - rather, I want it to just take the newly stashed file and use that to flash the attached hardware, rather than look on the repo for it.
I seemingly can't find an option to prevent this from happening. What can I do to just use the stashed file? If it's not possible with stash, can it be done another way without the slave attempting to clone the repo?
Here's my Jenkinsfile:
pipeline {
agent none
stages {
stage('Build') {
agent {
label 'master'
}
steps {
sh 'cd application/.../example && make'
stash includes: 'application/.../example/example.bin', name: 'Flash'
}
}
stage('Test of Flash') {
agent {
label 'test_slave'
}
steps {
unstash 'Flash'
//Flashing step here
sh 'make check || true'
}
}
}
}
And here's the console log, starting with the master compiling:
obtained Jenkinsfile from 913...
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] node
Running on Jenkins in /var/jenkins_home/...
[Pipeline] {
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository git@bitbucket.org:...
//Later, the file compiles:
Generating binary and Printing size information:...
//Compiles, then:
[Pipeline] stash
Stashed 1 file(s)
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test of Flash)
[Pipeline] node
Running on test_slave in /home/debian/...
[Pipeline] {
[Pipeline] checkout //And it starts to clone the repo here!
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository git@bitbucket.org:...
I don't want it to do the above.