1、安装插件
2、编写Jenkinsfile
pipeline {
agent {label 'agent'}
options { skipDefaultCheckout() }
stages {
stage('test') {
steps {
script {
dir("${WORKSPACE}") {
ansiColor('xterm') {
// some block
echo "\033[32m=======绿色字=======\033[0m"
echo "\033[41;30m=======红底黑字=======\033[0m"
echo "\033[30m=======黑色字=======\033[0m"
echo "\033[31m=======红色字=======\033[0m"
echo "\033[33m=======黄色字=======\033[0m"
echo "\033[46;30m=======天蓝底黑字=======\033[0m"
echo "\033[4;31m=======下划线红字=======\033[0m"
echo "\033[5;31m=======红字在闪烁=======\033[0m"
}
ansiColor('vga') {
// some block
echo "\033[32m=======绿色字=======\033[0m"
echo "\033[41;30m=======红底黑字=======\033[0m"
echo "\033[30m=======黑色字=======\033[0m"
echo "\033[31m=======红色字=======\033[0m"
echo "\033[33m=======黄色字=======\033[0m"
echo "\033[46;30m=======天蓝底黑字=======\033[0m"
echo "\033[4;31m=======下划线红字=======\033[0m"
echo "\033[5;31m=======红字在闪烁=======\033[0m"
}
ansiColor('css') {
// some block
echo "\033[32m=======绿色字=======\033[0m"
echo "\033[41;30m=======红底黑字=======\033[0m"
echo "\033[30m=======黑色字=======\033[0m"
echo "\033[31m=======红色字=======\033[0m"
echo "\033[33m=======黄色字=======\033[0m"
echo "\033[46;30m=======天蓝底黑字=======\033[0m"
echo "\033[4;31m=======下划线红字=======\033[0m"
echo "\033[5;31m=======红字在闪烁=======\033[0m"
}
}
}
}
}
}
}
网友评论