1. Нам важно Ваше мнение!
    и обсуждайте вместе! Нажимайте "мне нравится" и рекомендуйте друзьям ;)
    Понравилось тема? Напишите в ней свой отзыв.
    Считаете что тема не достаточно полно раскрыта? Расскажите свою точку зрения!
    С Вашей помощью сделаем форум еще лучше!
IowaEn

Top news todays - REMMONT.COM

Тема в разделе 'Свободное общение и OFF-топик', создана пользователем IowaEn, 19 май 2021.

  1. IowaEn

    IowaEn Member

    Azure devops semantic versioning - Рдуард Кабринский


    <h1>Azure devops semantic versioning</h1>
    <p>[youtube]</p>
    Azure devops semantic versioning <a href="http://remmont.com">America news today</a> Azure devops semantic versioning
    <h1>Azure devops semantic versioning</h1>
    <p>As part of ongoing work to enhance an existing Azure DevOps CI/CD pipeline that builds and deploys an ASP.NET Core application I thought I'd spend a pleasant 5 minutes versioning the .NET Core assemblies with the pipeline's build number. A couple of hours and 20+ test builds later.</p>
    <p>Out of the box, creating a new build in Azure Pipelines using the ASP.NET Core template in the classic editor results in five tasks of which four are concerned with <strong>dotnet</strong> commands:</p>
    <p style="clear: both"><img src="https://i1.wp.com/pleasereleaseme.n...019/06/azure-devops-asp-net-core-template.png" /></p>
    <p>A quick look at the documentation for dotnet build and then this awesome blog post that explains the dizzying array of options and it's pretty clear that adding <strong>/p:Version=$(Build.BuildNumber)</strong> as a command line parameter to <strong>dotnet build</strong> should suffice as a good starting point. Except it didn't, with <strong>File version</strong> and <strong>Product version</strong> stubbornly remaining at their default values:</p>
    <p style="clear: both"><img src="https://i1.wp.com/pleasereleaseme.n...019/06/contoso-university-file-properties.png" /></p>
    <p>I established that <strong>/p:Version=</strong> works fine from a command line, so what's going on? After a bit of research and testing I discovered that unless you tell it otherwise <strong>dotnet publish</strong> (and <strong>dotnet test</strong> for that matter) compiles the application before doing its thing of publishing files to a folder. The way the Azure Pipelines tasks are configured means that <strong>dotnet publish</strong> is effectively cancelling out the effect of <strong>dotnet build</strong>. (And since <strong>dotnet test</strong> also cancels out out the effect of <strong>dotnet build</strong> leaves me wondering what is the point of including <strong>dotnet build</strong> in the first place?) As part of this research I also discovered that <strong>build</strong>, <strong>test</strong> and <strong>publish</strong> also do a <strong>restore</strong> unless told otherwise, again making me wonder what the point of the <strong>Restore</strong> task is? So out of the box then it seems like the four .NET Core tasks are resulting in lots of duplication and for someone like me the cause of head-scratching as to why assembly versioning doesn't work.</p>
    <p>So based on a few hours of testing here is what I think the <strong>arguments</strong> of the different tasks need to be (for visual tasks or as YAML) to avoid duplication and implement assembly versioning.</p>
    <p>Firstly, if you want to include an implicit <strong>Restore</strong> task:</p>
    <p><ul>
    <li>build = --configuration $(BuildConfiguration) --no-restore /p:Version=$(Build.BuildNumber)</li>
    <li>test = --configuration $(BuildConfiguration) --no-build</li>
    <li>publish = --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingdirectory) --no-build</li>
    </ul>
    </p>
    <p>Secondly, if you want to omit an explicit <strong>Restore</strong> task:</p>
    <p><ul>
    <li>test = --configuration $(BuildConfiguration)</li>
    <li>publish = --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingdirectory) /p:Version=$(Build.BuildNumber)</li>
    </ul>
    </p>
    <p>In the first version <strong>build</strong> creates the binaries which are then used by <strong>test</strong> and <strong>publish,</strong> with the <strong>--no-build</strong> switch implicitly setting the <strong>--no-restore</strong> flag. I haven't tested it but that presumably means that <strong>--configuration $(BuildConfiguration)</strong> for <strong>test</strong> and <strong>publish</strong> is redundant.</p>
    <p><strong>Update</strong> A friend and former colleague Tweeted that <strong>--configuration</strong> is still needed for test and publish:</p>
    <blockquote><p>Been looking at this today. The -c flag is a bit redundant for test & publish but you should include it as -c defaults to ?debug'. Doing ?dotnet build -c release' and not adding ?-c release' to dotnet test means dotnet test will look in bin/debug not in bin/release instead</blockquote></p>
    <p> <br />In the second version <strong>test</strong> and <strong>publish</strong> both create their own sets of binaries. (Is that the right thing to do from a purist CI/CD perspective? Maybe, maybe not.)</p>
    <p>I did my testing on a Microsoft-hosted build agent and whilst it felt like both options above were quicker than the default settings I can't be certain without rigorous testing on a self-hosted agent with no other load. Either way though, it feels good to have optimised the tasks and I finally got assembly versioning working. Are there other optimisations? Have I missed something? Please leave a comment!</p>
    <h2>Azure devops semantic versioning</h2>

    <h3>Azure devops semantic versioning</h3>
    <p>[youtube]</p>
    Azure devops semantic versioning <a href="http://remmont.com">Today news live</a> Azure devops semantic versioning
    <h4>Azure devops semantic versioning</h4>
    There's more to versioning .NET Core assemblies in Azure DevOps than meets the eye. Here I explain the problems I encountered and how I overcame them.
    <h5>Azure devops semantic versioning</h5>
    Azure devops semantic versioning <a href="http://remmont.com">Azure devops semantic versioning</a> Azure devops semantic versioning
    SOURCE: <h6>Azure devops semantic versioning</h6> <a href="https://dev-ops.engineer/">Azure devops semantic versioning</a> Azure devops semantic versioning
    #tags#[replace: -,-Azure devops semantic versioning] Azure devops semantic versioning#tags#
    https://ssylki.info/?who=buy-new-car.remmont.com https://ssylki.info/?who=rental.remmont.com/secret-spa https://ssylki.info/?who=remmont.com/police-bf-2 https://ssylki.info/?who=remmont.co...nk-hongkong-citibank-careers-citibank-careers https://ssylki.info/?who=education-loan.remmont.com

Поделиться этой страницей