Skip to content

Commit

Permalink
use v6 of GitVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Jul 25, 2024
1 parent 7e67570 commit 1be4fce
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 106 deletions.
36 changes: 18 additions & 18 deletions .azure/different-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ stages:
- stage: GitVersion_Stage
displayName: Use GitVersion
jobs:
- job: GitVersion_v5_Job
displayName: GitVersion v5
- job: GitVersion_v6_Job
displayName: GitVersion v6
pool:
vmImage: 'ubuntu-latest'
steps:
Expand All @@ -13,32 +13,32 @@ stages:
- task: gittools.gittools.setup-gitversion-task.gitversion/[email protected]
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
versionSpec: '6.x'
includePrerelease: false

- task: gittools.gittools.execute-gitversion-task.gitversion/[email protected]
name: version_step # step id used as reference for output values
displayName: Use GitVersion
inputs:
useConfigFile: true
configFilePath: 'GitVersion_v5.yml'
configFilePath: 'GitVersion_v6.yml'
overrideConfig: |
update-build-number=false
- stage: GitVersion_without_prefix
condition: and(succeeded(), eq(dependencies.GitVersion_Stage.outputs['GitVersion_v5_Job.version_step.branchName'], 'main')) # use in condition
condition: and(succeeded(), eq(dependencies.GitVersion_Stage.outputs['GitVersion_v6_Job.version_step.branchName'], 'main')) # use in condition
dependsOn:
- GitVersion_Stage
displayName: Use Output from previous stage
jobs:
- job: Use_GitVersion_v5_without_prefix
- job: Use_GitVersion_v6_without_prefix
displayName: Use Output from previous stage (without prefix)
variables:
myvar_major: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.major'] ] # set in variables
myvar_minor: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.minor'] ]
myvar_patch: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.patch'] ]
myvar_semVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.semVer'] ]
myvar_fullSemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.fullSemVer'] ]
myvar_major: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.major'] ] # set in variables
myvar_minor: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.minor'] ]
myvar_patch: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.patch'] ]
myvar_semVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.semVer'] ]
myvar_fullSemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.fullSemVer'] ]
pool:
vmImage: 'windows-latest'
steps:
Expand Down Expand Up @@ -84,19 +84,19 @@ stages:
localvar_fullSemVer: $(myvar_fullSemVer)
- stage: GitVersion_with_prefix
condition: and(succeeded(), eq(dependencies.GitVersion_Stage.outputs['GitVersion_v5_Job.version_step.GitVersion_BranchName'], 'main')) # use in condition
condition: and(succeeded(), eq(dependencies.GitVersion_Stage.outputs['GitVersion_v6_Job.version_step.GitVersion_BranchName'], 'main')) # use in condition
dependsOn:
- GitVersion_Stage
displayName: Use Output from previous stage (with prefix)
jobs:
- job: Use_GitVersion_v5_with_prefix
- job: Use_GitVersion_v6_with_prefix
displayName: Use Output from previous stage (with prefix)
variables:
myvar_GitVersion_Major: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.GitVersion_Major'] ] # set in variables
myvar_GitVersion_Minor: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.GitVersion_Minor'] ]
myvar_GitVersion_Patch: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.GitVersion_Patch'] ]
myvar_GitVersion_SemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.GitVersion_SemVer'] ]
myvar_GitVersion_FullSemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v5_Job.outputs['version_step.GitVersion_FullSemVer'] ]
myvar_GitVersion_Major: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.GitVersion_Major'] ] # set in variables
myvar_GitVersion_Minor: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.GitVersion_Minor'] ]
myvar_GitVersion_Patch: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.GitVersion_Patch'] ]
myvar_GitVersion_SemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.GitVersion_SemVer'] ]
myvar_GitVersion_FullSemVer: $[ stageDependencies.GitVersion_Stage.GitVersion_v6_Job.outputs['version_step.GitVersion_FullSemVer'] ]
pool:
vmImage: 'windows-latest'
steps:
Expand Down
8 changes: 4 additions & 4 deletions .azure/same-job.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jobs:
- job: GitVersion_v5_same_job
displayName: GitVersion v5 (same job)
- job: GitVersion_v6_same_job
displayName: GitVersion v6 (same job)
strategy:
matrix:
windows-latest:
Expand All @@ -18,15 +18,15 @@ jobs:
- task: gittools.gittools.setup-gitversion-task.gitversion/[email protected]
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
versionSpec: '6.x'
includePrerelease: false

- task: gittools.gittools.execute-gitversion-task.gitversion/[email protected]
name: version_step # step id used as reference for output values
displayName: Use GitVersion
inputs:
useConfigFile: true
configFilePath: 'GitVersion_v5.yml'
configFilePath: 'GitVersion_v6.yml'
overrideConfig: |
update-build-number=false
Expand Down
40 changes: 20 additions & 20 deletions .azure/same-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ stages:
- stage: GitVersion
displayName: Use GitVersion
jobs:
- job: GitVersion_v5_Job
displayName: GitVersion v5
- job: GitVersion_v6_Job
displayName: GitVersion v6
pool:
vmImage: 'ubuntu-latest'
steps:
Expand All @@ -13,29 +13,29 @@ stages:
- task: gittools.gittools.setup-gitversion-task.gitversion/[email protected]
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
versionSpec: '6.x'
includePrerelease: false

- task: gittools.gittools.execute-gitversion-task.gitversion/[email protected]
name: version_step # step id used as reference for output values
displayName: Use GitVersion
inputs:
useConfigFile: true
configFilePath: 'GitVersion_v5.yml'
configFilePath: 'GitVersion_v6.yml'
overrideConfig: |
update-build-number=false
- job: Use_GitVersion_v5_without_prefix
- job: Use_GitVersion_v6_without_prefix
dependsOn:
- GitVersion_v5_Job
- GitVersion_v6_Job
displayName: Use Output from previous job (without prefix)
condition: and(succeeded(), eq(dependencies.GitVersion_v5_Job.outputs['version_step.branchName'], 'main')) # use in condition
condition: and(succeeded(), eq(dependencies.GitVersion_v6_Job.outputs['version_step.branchName'], 'main')) # use in condition
variables:
myvar_major: $[ dependencies.GitVersion_v5_Job.outputs['version_step.major'] ] # set in variables
myvar_minor: $[ dependencies.GitVersion_v5_Job.outputs['version_step.minor'] ]
myvar_patch: $[ dependencies.GitVersion_v5_Job.outputs['version_step.patch'] ]
myvar_semVer: $[ dependencies.GitVersion_v5_Job.outputs['version_step.semVer'] ]
myvar_fullSemVer: $[ dependencies.GitVersion_v5_Job.outputs['version_step.fullSemVer'] ]
myvar_major: $[ dependencies.GitVersion_v6_Job.outputs['version_step.major'] ] # set in variables
myvar_minor: $[ dependencies.GitVersion_v6_Job.outputs['version_step.minor'] ]
myvar_patch: $[ dependencies.GitVersion_v6_Job.outputs['version_step.patch'] ]
myvar_semVer: $[ dependencies.GitVersion_v6_Job.outputs['version_step.semVer'] ]
myvar_fullSemVer: $[ dependencies.GitVersion_v6_Job.outputs['version_step.fullSemVer'] ]
pool:
vmImage: 'windows-latest'
steps:
Expand Down Expand Up @@ -80,17 +80,17 @@ stages:
localvar_semVer: $(myvar_semVer)
localvar_fullSemVer: $(myvar_fullSemVer)
- job: Use_GitVersion_v5_with_prefix
- job: Use_GitVersion_v6_with_prefix
dependsOn:
- GitVersion_v5_Job
- GitVersion_v6_Job
displayName: Use Output from previous job (with prefix)
condition: and(succeeded(), eq(dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_BranchName'], 'main')) # use in condition
condition: and(succeeded(), eq(dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_BranchName'], 'main')) # use in condition
variables:
myvar_GitVersion_Major: $[ dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_Major'] ] # set in variables
myvar_GitVersion_Minor: $[ dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_Minor'] ]
myvar_GitVersion_Patch: $[ dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_Patch'] ]
myvar_GitVersion_SemVer: $[ dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_SemVer'] ]
myvar_GitVersion_FullSemVer: $[ dependencies.GitVersion_v5_Job.outputs['version_step.GitVersion_FullSemVer'] ]
myvar_GitVersion_Major: $[ dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_Major'] ] # set in variables
myvar_GitVersion_Minor: $[ dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_Minor'] ]
myvar_GitVersion_Patch: $[ dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_Patch'] ]
myvar_GitVersion_SemVer: $[ dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_SemVer'] ]
myvar_GitVersion_FullSemVer: $[ dependencies.GitVersion_v6_Job.outputs['version_step.GitVersion_FullSemVer'] ]
pool:
vmImage: 'windows-latest'
steps:
Expand Down
Loading

0 comments on commit 1be4fce

Please sign in to comment.