我想创建Jenkins Groovy管道(RHEL Slave)中的内容文件。
现在我使用以下命令
steps {
script {
sh """
cat <<EOF >>file.sh
echo 'Hello world'
EOF
"""
}
}
}
但我是在运行Jenkins作业时收到这条消息的。
2022-09-27 21:21:06 /apps/jenkins/workspace/xxxx/xxxxxx@tmp/durable-aa115c9c/script.sh: line 7: warning: here-document at line 2 delimited by end-of-file (wanted `EOF')
2022-09-27 21:21:06 + cat
我已经检查了EOF的空间,但仍然没有工作。
请帮忙提个建议。
1条答案
按热度按时间zpjtge221#
做下面这样的事情不是很容易吗?只需将STDOUT重定向到一个文件。