【发布时间】:2021-03-15 04:23:32
【问题描述】:
对不起,我对 Azure DevOps 有点陌生(我通常使用 Github Actions,不幸的是,我的任务是在 AzureDevOps 上执行此操作)无论如何,我想知道是否可以在成功后自动增加我分支上的标签部署?这是我当前在 AzureDevOps 上的设置。
- script: |
LastStableTag=`git tag -l testTag_v* --sort=creatordate | tail -n1`
echo $LastStableTag
CurrentCommitID=`git rev-parse --verify HEAD`
echo $CurrentCommitID
npx sfdx sfpowerkit:project:diff -t $CurrentCommitID -r $LastStableTag -d delta
displayName: 'Generate Delta'
基本上,我所做的是了解 Salesforce 组件在功能分支和开发分支之间的差异(基于最新标签)。首先验证它,然后在它通过并合并后,另一个管道将运行并进行实际部署。
在 GitHub Actions 上,这是我用来增加标签、碰撞和推送下一个版本的代码。我确实尝试在 Azure DevOps 上执行此操作,但我被卡住了,不知道下一步该做什么。有什么办法可以在 Azure DevOps 上做到这一点?还是我应该采用不同的方法?任何帮助将不胜感激!谢谢。
- name: Get next version
run: |
CurrentVersion=`git tag -l testtag_v* --sort=creatordate | tail -n1 | awk -F'v' '{print $2}'`
echo CURRENT VERSION: $CurrentVersion
major=`echo $current_version | cut -d'.' -f 1`
minor=`echo $current_version | cut -d'.' -f 2`
minor=`expr $minor + 1`
patch=`echo $current_version | cut -d'.' -f 3`
NextVersion=`echo $major.$minor.$patch`
echo NEXT VERSION: $NextVersion
echo "::set-output name=next_version::$(echo $NextVersion)"
id: NextVersion
- name: Zip delta folder
run: |
zip -r delta.zip delta/
- name: Bump version and push tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "secrets"
prerelease: true
automatic_release_tag: "testtag_v${{ steps.next_version.outputs.NextVersion }}"
files: |
delta.zip
【问题讨论】:
-
您好,我添加了一个答案,请查看。如果我误解了你,你能更详细地描述你的问题吗?谢谢。
标签: azure azure-devops continuous-integration yaml azure-pipelines