Timestamper plugin: Adds timestamps to the Console Output
Method One: use options
1 |
//declarative pipeline |
Example output:
1 |
16:21:40 + echo 23 |
Method Two: use wrap
//declarative pipeline
pipeline {
agent any
stages {
stage('Stage with timestamp'){
steps{
sh "echo ${env.BUILD_NUMBER}"
wrap([$class: 'TimestamperBuildWrapper']) {
echo "Done"
}
}
}
}
}
默认是到分钟级别,到秒级别的需要自己定义格式,或者在菜单左侧,选择“Elapsed time”
More Ref:
打赏
近期评论