Skip to content

Azure DevOps Build Configuration

Mötz Jensen edited this page Nov 2, 2018 · 7 revisions

Prerequisites

You will need a Personal Access Token configured in your github account. Read this guide to obtain that.

Configure Github Access

  1. Navigate to your Azure DevOps project
  2. Click on the "Project settings" icon in the bottom left corner of the page

  1. Select the "Service connections" menu option, under the "Pipelines" section in the new navigation tile on the left
  2. Select "Github" from the "New service connection" dropdown list

  1. Select the "Personal access token" option in the "Choose authorization" configuration
  2. Fill in a desired name for this connection that you are creating in the "Connection Name" configuration
  3. Fill in your token that you have created on Github in the "Token" configuration

  1. Validate that the "Service Connection" is created as desired and go back to your Azure DevOps project start page

Setup the build pipeline

  1. Select the "Pipelines" menu option in the navigation on the left
  2. Select the "Builds" menu option that is revealed under the "Pipelines" section in the navigation on the left
  3. Click the "+ New" iceon and select the "New build pipeline" from the dropdown

Or if you never did create a build pipeline it will just show you a empty page with just one button to click

  1. You have to select the "Github" option and validate that it selects the current "Service Connection" created earlier
  2. Select the github repository you want to build
  3. Select the default branch that the build pipeline should build when you initiate a manuel build
    • "master" is the normal default
  4. Click continue when ready

  1. Select the "Empty job" option in the very top of the page

  1. Select the new Agent job 1 and click on the + sign
  2. Search for PowerShell and add 2 x PowerShell tasks

  1. Search for Publish Test Results and add only 1

  1. Validate that you have 2 PowerShell tasks and 1 Publish Test Results

  1. Select the first PowerShell task, name it "Prerequisites"
  2. Fill in "build/vsts-prerequisites.ps1" into the "Script Path"

  1. Select the second PowerShell task, name it "Validate"
  2. Fill in "build/vsts-validate.ps1" into the "Script Path"

  1. Select the Publish Test Results and change the "Test result format" from "JUnit" to "NUnit"
  2. Expand the "Control Options" section and change the "Run this task" value from "Only when all previous tasks have succeeded" to "Even if a previous task has failed, even if the build was canceled"

  1. When ready click on the "Save & queue" button in the top menu and select the "Save" option from the dropdown menu

  1. Go back to the build pipeline overview and "Queue" a new build
  2. Accept the default values from the popup

  1. Once the build is done and error free, you can continue the configuration of your github repository and branch protection
Clone this wiki locally