1 min read

Build configuration

Prerequisites

  • BFC API up and running locally

Steps

  1. Remove any sensitive data from config files, in particular do not forget to update following fields:
    1. Replace Redis connection string with empty value “”
  2. Replace any sensitive data that is required to execute unit tests by wildcards, in particular set following values:
    1. Replace ClientId value with “#{SfccClientId[YourClientName]Dev}#”, for ex: “#{SfccClientIdAmazingClientDev}#” (this syntax required as this value will be replaced during build step to make sure that integration tests that run as unit tests can execute successfully)
  3. Open azure-pipeline-build.yml and update following values keeping same casing (those should be already updated by the API template engine):
    1. ClientName -> [YourClientName]. For client name Yourbrand file will look like this:
resources:
repositories:
- repository: templates
type: github
name: poqcommerce/Poq.Devops.Scripts
endpoint: poqcommerce
#Only use when testing new features. Defaults to master.
#ref: feature/pipelines
trigger:
- main
stages:
- stage: build
displayName: Build + Test
variables:
- group: 'Build Variables'
jobs:
- template: Pipelines/TaskGroups/build-netcore.yml@templates
parameters:
poolImage: 'vs2017-win2016'
BuildConfiguration: 'Release'
buildPathProjects: 'Poq.Api.Yourbrand/**/*.csproj'
NugetConfigPath: 'NuGet.config'
publishPathprojects: 'Poq.Api.Yourbrand/Poq.Api.Yourbrand/Poq.Api.Yourbrand.csproj'
restorePathProjects: 'Poq.Api.Yourbrand/**/*.csproj'
targetReplaceFiles: '**/*.json'
testPathProjects: 'Poq.Api.Yourbrand/**/*[Tt]ests**.csproj'
  1. Create the PR for BFC API
  2. Merge the PR
  3. Go to your Azure DevOps account
  4. Find project setup by Devops team for your client, should be something like “Poq.[YourClientName]
  5. Go go Pipelines
  6. Press New pipeline, then
    1. Github
    2. Continue
    3. Select your client BFC API repo
    4. Existing Azure Pipeline YAML file
    5. Select /azure-pipeline-build.yml
    6. Continue
  7. Go to “Build Variables” variables group and add following values (this step required for the integration tests that run as unit tests during build step can work)
    1. SfccClientId[YourClientName]Dev : [OcapiClientIdValue]
  8. Select newly created build pipeline and press Run Pipeline
  9. Make sure that build runs as expected
Congratulations, you have successfully configured the Build pipeline.

See Next