Incorrect GitVersion config results in odd versioning
I've a Solution that invokes GitVersion in Azure DevOps.
The repo was last tagged "1.4.1".
GitVersion.yaml reads
mode: Mainline
branches:
feature:
increment: Minor
hotfix:
increment: Patch
The last master build resulted in build 1.4.1
as expected.
I created a new feature branch from master (feature/My_BranchName) and that resulted in build 1.5.0-My_BranchName.1
. But when I create a pull request, the resulting build is 1.4.2-PullRequest1234.1
merging it to master results in 1.4.3
.
I was expecting the PR to generate 1.5.0-PullRequest1234.1
and the merge 1.5.0
I can't figure out why I'm getting the results I am and would appreciate a pointer or an explanation of why it's doing what it's doing.
do you know?
how many words do you know
See also questions close to this topic
-
How to exclude tagged commit
I have a build pipeline in Azure Pipelines with
trigger: branches: include: - '*' tags: include: - v/*
In other words: I build all branches (in practice I only have one), and all tags that start with
v/
(these are my releases).When I push a commit and its tag, Azure Pipelines kicks off two builds - one for the branch and one for the tag - even though they're the same commit. This takes up unnecessary pipeline resources, particularly when I want to release from many repositories at the same time.
Is there a way to skip the "branch build" of a commit (or cancel if ongoing) when a "tag build" of the same commit is started?
-
Automate Azure Devops (FTP Upload) and Git to upload on Remote Server
The current setup is as below
- Version Control - Git
- Repos and Branch hosted on - Azure DevOps
- Codebase - External server
The dev team clones Azure Repo into local git project and any staged changes are committed via Git and pushed to specific branch of Azure DevOps. In this setup we would want to upload the changes to external FTP servers and avoid manual upload. Currently trying to use Azure Devops FTP Upload Task (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops), however facing issues; yaml script as below
trigger: - main pool: vmImage: 'ubuntu-latest' variables: phpVersion: 7.4 webAppName: 'Test Project' buildConfiguration: 'Release' vmImageName: 'ubuntu-latest' steps: - publish: $(System.DefaultWorkingDirectory)/AzureRepoName artifact: Test Project Deploy - task: FtpUpload@2 displayName: 'FTP Upload' inputs: credentialsOption: inputs serverUrl: 'ftps://00.00.00.00:22' username: ftp-username password: ftp-password rootDirectory: '$(System.DefaultWorkingDirectory)/AzureRepoName' remoteDirectory: '/home/public_html' clean: false cleanContents: false preservePaths: true trustSSL: true
PROBLEM
Following errors occur when I commit (for test purposes) something.
Starting: PublishPipelineArtifact ============================================================================== Task : Publish Pipeline Artifacts Description : Publish (upload) a file or directory as a named artifact for the current run Version : 1.199.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact ============================================================================== Artifact name input: Test Project Deploy ##[error]Path does not exist: /home/vsts/work/1/s/AzureRepoName Finishing: PublishPipelineArtifact
I want to upload any staged change that is committed to main branch on Azure Devops to be automatically deploy on the remote FTP server
Thanks
-
Migrate Azure Devops Artifacts between organizations
I am trying to migrate (clone) an Azure Devops project to another project / organization. I successfully
- cloned the repos
- migrated the work items using Azure DevOps Migration Tools by NkdAgility
- I exported the build and release pipelines as json files and imported them again.
- I created a selfhosted agent on my VM and trying to run the build pipelines - the job "dotnet restore" on that.
- I created a new feed under Artifacts. Unfortunately the job with dotnet restore fails because it relies on the artifacts only available in the old project
How can I migrate the packages from the feeds of the old project to the new one(s)?
I assume I am supposed to clone the feeds of the old project somehow so that I can simply update the nuget.config with the name of the new organization. Thank you in advance.
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <!-- remove any machine-wide sources with <clear/> --> <clear /> <!-- also get packages from the NuGet Gallery --> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="DotNetArcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> <add key="<OLD_FEED1" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED1>/nuget/v3/index.json" /> <add key="<OLD_FEED2" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED2>/nuget/v3/index.json" /> <add key="<OLD_FEED3" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED3>/nuget/v3/index.json" /> </packageSources> <activePackageSource> <add key="All" value="(Aggregate source)" /> </activePackageSource> </configuration>
-
Azure DevOps trigger at pipeline completion using different branch than expected
In the workflow of a pipeline triggering another pipeline according to this doc, I'm trying to set:
- feature-branch PR to develop-branch triggers stage-ci
- stage-ci runs, triggers stage-cd
- pipeline stage-cd runs
But in step 3, it gets the default branch, not the feature-branch. Does anyone know why this is happening? When the trigger in stace-ci is
trigger
(notpr
) it works finestage-ci.yaml:
trigger: none pr: branches: include: - develop
stage-cd.yaml
trigger: none pr: none resources: pipelines: - pipeline: stage-ci source: stage-ci trigger: true
-
Azure DevOps pipeline how set vcvars64.bat then call msbuild.exe from batch file?
On a local machine, I execute my build.bat after opening a x64 Native Tools Command Prompt for VS 2019, then build.bat calls msbuild.exe.
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" build.bat
How can I do same in an Azure DevOps pipeline CmdLine task?
The build.bat call to msbuild.exe fails when called from azure-pipelines.yml CmdLine task.
Is there a reliable method to locate and call vcvars64.bat so that msbuild.exe can be found?
- task: CmdLine@2 displayName: 'build.bat calls msbuild' inputs: script: | build.bat
Azure pipeline error:
2022-05-06T15:42:53.3802703Z 'msbuild' is not recognized as an internal or external command, 2022-05-06T15:42:53.3803010Z operable program or batch file.
Thanks in advance for any tips or direction.
-
GitVersion: Multiple branch configurations match the current branch branchName of 'dev' Warning Message
I am having an issue with GitVersion appending a "warning" message to the versioning metadata.
Multiple branch configurations match the current branch branchName of 'dev'. Using the first matching configuration, 'dev'. Matching configurations include:' - dev - develop'
Our project repo is a bit unconventional with a branching structure of
dev
,qa
, andprod
. I've to add branching configs in the GitVerion.yml file but it doesn't seem to work.GitVersion.yml
mode: MainLine assembly-versioning-scheme: MajorMinorPatch major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' patch-version-bump-message: '\+semver:\s?(fix|patch)' no-bump-message: '\+semver:\s?(none|skip)' commit-message-incrementing: Enabled ignore: sha: [] increment: Inherit commit-date-format: dd-MM-yyyy merge-message-formats: {} branches: dev: regex: ^dev$ is-mainline: true is-source-branch-for: ['feature'] source-branches: []
The version of GitVerison we're using is
5.6.12-beta.1+8.Branch.main.Sha.fee39bbb6cde7a33f9ed84e5b35d1df93781163a
Any help would be most appreciated! Thanks!
-
YAML - Not ignoring the commits-before
I'm having a weird issue with a YAML pipeline. I'm using gitversion and need to baseline the version, so the testing etc... that was done with commits doesn't increment the semver and I can re-baseline. I've added the code to do this in my GitVerison file.
mode: Mainline branches: {} ignore: sha: [] commits-before: 2020-05-01T00:00:00 merge-message-formats: {}
The problem is that its not ignoring the commits-before and it is still incrementing with every commit.
I see this bug open but not much other details. https://github.com/GitTools/GitVersion/issues/3074
Please help. Thank you in advance.