我有以下设置:
当我运行以下管道时:
pipeline {
agent { node { label 'dockerslave' } }
stages {
stage('Example Build') {
agent { docker { image 'maven:3-alpine' } }
steps {
echo 'Hello, Maven'
sh 'mvn --version'
}
}
stage('Example Test') {
agent { docker { image 'openjdk:8-jre' } }
steps {
echo 'Hello, JDK'
sh 'java -version'
}
}
}
}
我得到以下logoutput:
[Pipeline] node
Running on dockerslave in /home/jenkins/workspace/docker-
declarative
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Example Build)
[Pipeline] node
Still waiting to schedule task
There are no nodes with the label ?latest?
作业不会继续并挂起。 这有什么问题?
答案 0 :(得分:1)
问题是失踪:
reuseNode true
固定的例子:
pipeline {
agent {
node { label 'dockerslave' } }
stages {
stage('Example Build') {
agent {
docker {
reuseNode true
image 'maven:3-alpine'
}
}
steps {
echo 'Hello, Maven'
sh 'mvn --version'
}
}
stage('Example Test') {
agent {
docker {
reuseNode true
image 'openjdk:8-jre'
}
}
steps {
echo 'Hello, JDK'
sh 'java -version'
}
}
}
}