dev*_*rts 6 jenkins jenkins-pipeline
我遇到了一个管道脚本的奇怪问题.我有一个多行sh blob喜欢
sh """
git tag -fa \\"${version}\\" -m \\"Release of ${version}\\"
"""
Run Code Online (Sandbox Code Playgroud)
而这在某种程度上运行:
+ git tag -fa '"1.0-16-959069f'
error: Terminal is dumb, but EDITOR unset
Please supply the message using either -m or -F option.
Run Code Online (Sandbox Code Playgroud)
所以它放弃了-m和消息.我试过单逃,双逃,似乎没什么用.
我不知道为什么这有效,但确实如此
def tagGithub(String version) {
def exec = """
git tag -d ${version} || true
git push origin :refs/tags/${version}
# tag new version
git tag -fa ${version} -m "Release of ${version}"
git push origin --tags
"""
sh exec
}
Run Code Online (Sandbox Code Playgroud)
内联詹金斯常规插值的某些内容似乎被破坏了,在另一个变量中进行插值然后执行它有效
| 归档时间: |
|
| 查看次数: |
5661 次 |
| 最近记录: |