2

I'm trying to figure out how to push a tag after a successful build back to the azure devops git repository. Whether I'm just asking the wrong questions or going about it wrong I'm just not sure, but I am at the point where I'd better reach out for help. I'm new to Azure Devops, not new to Git. I'm also new to nuke build - I used cake at my last job and really wanted to give nuke a try, but the company insisted on cake.

I see in the AzureDevops docs that I should be able to set "persistCredentials" and that should put the token into the credential manager for that session... but it seems like there ought to be something in the nuke components that would either set that or allow me to set it. I'm just not sure I'm looking in the right place.

Right now, I've built a target like the following:

Target Tag => _ => _
        .DependsOn(Pack)
        .Executes(() =>
        {
            Git($"config --global user.email \"build@ourcompany.com\"");
            Git($"config --global user.name \"Our Company Build\"");

            Git($"tag -a {GitVersion.FullSemVer} -m \"Setting git tag on commit to '{GitVersion.FullSemVer}'\"");
            Git($"push --set-upstream origin {GitRepository.Branch}");
        });

So I might be going about this completely wrong - if so, I'm up for correction or a point in the right direction. Thank you in advance!!!

Toadicus Rex
  • 35
  • 1
  • 6

1 Answers1

0

I think you have to specify the tag name you want to push. So your last line should rather be

Git($"push --set-upstream origin {GitVersion.FullSemVer}");
bitbonk
  • 48,890
  • 37
  • 186
  • 278
  • Right - yeah, I guess I pushed up an earlier version. The following works on Windows build pipelines but not linux: – Toadicus Rex Apr 25 '22 at 15:52
  • Git($"config --global user.email \"build@ourcompany.com\""); Git($"config --global user.name \"Our Company Build\""); Git($"tag -a {GitVersion.FullSemVer} -m \"Setting git tag on commit to '{GitVersion.FullSemVer}'\""); Git($"push https://{AzurePipelines.Instance.AccessToken}@dev.azure.com//{AzurePipelines.Instance.TeamProject}/_git/{AzurePipelines.Instance.RepositoryName} --tags"); – Toadicus Rex Apr 25 '22 at 15:52