Jenkins Pipeline: read a file an
作者:
_fishman | 来源:发表于
2020-07-23 17:49 被阅读0次pipeline {
agent { label 'master' }
stages {
stage('write') {
steps {
script {
def date = new Date()
def data = "Hello World\nSecond line\n" + date
writeFile(file: 'zorg.txt', text: data)
sh "ls -l"
}
}
}
stage('read') {
steps {
script {
def data = readFile(file: 'zorg.txt')
println(data)
}
}
}
}
}
https://code-maven.com/jenkins-readfile-writefile
本文标题:Jenkins Pipeline: read a file an
本文链接:https://www.haomeiwen.com/subject/juwhlktx.html
网友评论