I'm new to Jenkins and I want to automatize my current workflow a little bit. Right now I push it to the raspberry. Then via SSH I pull the changes, run docker-compose build
and docker-compose up
afterwards.
My jenkins file is:
pipeline{
agent any
stages{
stage('build'){
steps{
script{
docker.withTool("default") {
sh 'docker-compose build'
}
}
}
}
stage('deploy'){
steps{
script{
docker.withTool("default") {
sh 'docker-compose up'
}
}
}
}
}
}
And when clicking 'build now' I get the following console-output:
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (build)
[Pipeline] script
[Pipeline] {
[Pipeline] tool
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (deploy)
Stage "deploy" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: No org.jenkinsci.plugins.docker.commons.tools.DockerTool named default found
Finished: FAILURE
I also tried running it with docker.withTool("docker") but that gave me the same results.