-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines-41.yml
30 lines (25 loc) · 992 Bytes
/
azure-pipelines-41.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# https://stackoverflow.com/questions/65121138/how-to-increment-tags-in-azure-devops-pipeline-salesforce
trigger: none
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
#!/bin/bash
STR="Hello World!"
echo $STR
- bash: |
#!/bin/bash
CurrentVersion2 = git tag -l testtag_v* --sort=creatordate | tail -n1 | awk -F'v' '{print $2}'
echo $CurrentVersion2
git tag -l testtag_v* --sort=creatordate | tail -n1 | awk -F'v' '{print $2}'
CurrentVersion = `git tag -l testtag_v* --sort=creatordate | tail -n1 | awk -F'v' '{print $2}'`
echo CURRENT VERSION: $CurrentVersion
major=`echo $CurrentVersion | cut -d'.' -f 1`
minor=`echo $CurrentVersion | cut -d'.' -f 2`
minor=`expr $minor + 1`
patch=`echo $CurrentVersion | cut -d'.' -f 3`
NextVersion=`echo $major.$minor.$patch`
echo NEXT VERSION: $NextVersion
echo "##vso[task.setvariable variable=next_version;]$NextVersion"
displayName: Get next version