【发布时间】:2020-08-14 14:11:01
【问题描述】:
对于我的 azure-pipeline.yml 文件,我想通过 bash 脚本分配变量以从 repoName 中获取斜杠后的名称作为我的 imageName
variables:
vmImageName: 'ubuntu-18.04'
repoName: $(Build.Repository.Name)
imageName: ${repoName##*/}
repoName 是 top/cci 我预计 imageName 的打印结果是 cci。但结果是 ${top/cci##*/}
如何在变量赋值过程中使用 bash 脚本来获取斜线后面的字符串?
【问题讨论】:
-
对不起,我不明白。你能说出你想在
imageName中拥有什么价值吗?
标签: bash variables azure-devops yaml azure-pipelines