1 min read
Build configuration
Prerequisites
- BFC API up and running locally
Steps
- Remove any sensitive data from config files, in particular do not forget to update following fields:
- Replace Redis connection string with empty value “”
- Replace any sensitive data that is required to execute unit tests by wildcards, in particular set following values:
- 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)
- Open azure-pipeline-build.yml and update following values keeping same casing (those should be already updated by the API template engine):
- 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'
- Create the PR for BFC API
- Merge the PR
- Go to your Azure DevOps account
- Find project setup by Devops team for your client, should be something like “Poq.[YourClientName]”
- Go go Pipelines
- Press New pipeline, then
- Github
- Continue
- Select your client BFC API repo
- Existing Azure Pipeline YAML file
- Select /azure-pipeline-build.yml
- Continue
- 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)
- SfccClientId[YourClientName]Dev : [OcapiClientIdValue]
- Select newly created build pipeline and press Run Pipeline
- Make sure that build runs as expected
Congratulations, you have successfully configured the Build pipeline.