azure-pipelines

VSTS Build - Choose which unit tests run depending on which files were modified in a pull request

非 Y 不嫁゛ 提交于 2020-12-11 04:33:18
问题 I would like to control which unit tests run in a VSTS build pipeline based on which files were modified in the PR that triggered the pipeline. Is there a way to detect which files were modified in a pull request during a VSTS build triggered for that PR, and then choose which tests to run based on that information? 回答1: Yes, this is possible: Manual Approach One approach to this is to have a custom Powershell task in your pipeline that sets a variable based on whether a certain file was

Can't build .Net 5 in pipeline

让人想犯罪 __ 提交于 2020-12-09 06:33:09
问题 I created a new solution 2 weeks ago using .Net 5 RC2. I've upgraded it to the new release (5.0.0). I'm trying to created a standard ASP.Net pipeline to build it, agent pool is Azure Pipelines, and agent specification I've tried both windows-2019 and vs2017-win2016. Both give the same errors as below Why is it trying to use 2.1? Checking compatibility for System.Composition.AttributedModel 1.0.31 with .NETFramework,Version=v5.0 (win7-x86). Checking compatibility for System.Composition.Runtime

How can you use secret variables from a linked variable group in an Azure Powershell task in an Azure Release pipeline?

倾然丶 夕夏残阳落幕 提交于 2020-12-07 06:40:49
问题 I have an Azure Release pipeline that I've built using the GUI in Azure DevOps. There is a stage that has a linked variable group (Release scope) with a secret variable in the variable group. The stage has an agent job with an Azure Powershell task that runs a script file. That script file references the secret variable using the syntax $env:MYSECRETVARIABLE but the value is null. When I add an Azure Powershell task for debugging that runs Get-ChildItem -Path Env:\ , I can see that all the

How can you use secret variables from a linked variable group in an Azure Powershell task in an Azure Release pipeline?

牧云@^-^@ 提交于 2020-12-07 06:39:25
问题 I have an Azure Release pipeline that I've built using the GUI in Azure DevOps. There is a stage that has a linked variable group (Release scope) with a secret variable in the variable group. The stage has an agent job with an Azure Powershell task that runs a script file. That script file references the secret variable using the syntax $env:MYSECRETVARIABLE but the value is null. When I add an Azure Powershell task for debugging that runs Get-ChildItem -Path Env:\ , I can see that all the

Azure Devops: Cannot Build an Image using NPM private registry even after setting NPM Authenticate

时光总嘲笑我的痴心妄想 提交于 2020-12-05 11:23:31
问题 I am always getting an error on npm install after setting NPM Authenticate. I would like to authenticate to my npm private registry during image build and install all the dependencies I need. Maybe I misunderstood how this authentication process works but this is what I am doing: Build pipeline I tried establishing a service connection from the project settings page as in Service connections for builds and releases After that, I also set up my NPM Authentication task following the steps in

Azure DevOps Build Submodule

半世苍凉 提交于 2020-12-05 03:42:26
问题 I have a private bitbucket repo that is connected to the Azure DevOps Build Pipeline. The private repo has a submodule connected to a public Github repo. Both repositories are accessed via SSH. I have ticked the clone submodules box in DevOps. How do I provide an SSH key to Azure DevOps so it will clone the submodule? 回答1: The solution for this was not to change to https, or setup a self hosted agent. There is a step available called Load an SSH key. I created a new ssh key on github, added

Azure DevOps Build Submodule

﹥>﹥吖頭↗ 提交于 2020-12-05 03:40:08
问题 I have a private bitbucket repo that is connected to the Azure DevOps Build Pipeline. The private repo has a submodule connected to a public Github repo. Both repositories are accessed via SSH. I have ticked the clone submodules box in DevOps. How do I provide an SSH key to Azure DevOps so it will clone the submodule? 回答1: The solution for this was not to change to https, or setup a self hosted agent. There is a step available called Load an SSH key. I created a new ssh key on github, added

Update JSON file using PowerShell

心已入冬 提交于 2020-12-02 05:54:02
问题 I am currently trying to setup a continuous integration system using VSTS and have run into a bit of a snag. As part of the release process I need to update a specific object value in a JSON file depending on the environment. The only tools it seems I have at my disposal that might get this done in the VSTS environment is PowerShell. I've done quite a bit of research and have not been able to figure out how exactly this can be done. I found this question and answer here on Stack Overflow "How

Update JSON file using PowerShell

橙三吉。 提交于 2020-12-02 05:52:52
问题 I am currently trying to setup a continuous integration system using VSTS and have run into a bit of a snag. As part of the release process I need to update a specific object value in a JSON file depending on the environment. The only tools it seems I have at my disposal that might get this done in the VSTS environment is PowerShell. I've done quite a bit of research and have not been able to figure out how exactly this can be done. I found this question and answer here on Stack Overflow "How

Azure Devops Running Two Builds Sequentially

旧时模样 提交于 2020-11-29 10:18:39
问题 We have Azure Devops setup. Right now our Project will Build Twice. Once during Pull Request Checkin in the YAML file, and another due to Build Settings (picture below). This triggers two builds, and causes our build time to double. Our Devops team mentioned this is regular practice. Why doesn't Azure Devops just trigger one build, and or is it safer practice with two builds? 回答1: Why doesn't Azure Devops just trigger one build, and or is it safer practice with two builds? As far as I know,