|
# Traditional CI/CD DevOps EXAMPLE BUILD Pipeline via Azure Pipelines via Azure DevOps |
|
# This yaml is provided only as an example to get started. You will have to update certain variables and fields according to your environment |
|
# This build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 |
|
|
|
# GitHub Repo used: https://github.com/jldeen/fabrikamfiber/tree/helm-2019-mssql-linux |
|
# Dockerfile link: https://github.com/jldeen/fabrikamfiber/blob/helm-2019-mssql-linux/FabrikamFiber.Web/Dockerfile |
|
|
|
resources: |
|
- repo: self |
|
queue: |
|
name: Default #self-hosted agent with Windows Server 2019 with Containers Support, Visual Studio and Docker installed |
|
demands: |
|
- msbuild |
|
- visualstudio |
|
variables: |
|
BuildPlatform: 'Any CPU' |
|
BuildConfiguration: 'Release' |
|
Parameters.solution: |
|
steps: |
|
- task: NuGetToolInstaller@0 |
|
displayName: 'Use NuGet 4.4.1' |
|
inputs: |
|
versionSpec: 4.4.1 |
|
- task: NuGetCommand@2 |
|
displayName: 'NuGet restore' |
|
inputs: |
|
restoreSolution: '$(Parameters.solution)' |
|
- task: VSBuild@1 |
|
displayName: 'Build solution **\*.sln' |
|
inputs: |
|
solution: '$(Parameters.solution)' |
|
msbuildArgs: '/p:PublishProfile=FolderProfile /p:DeployOnBuild=true' |
|
platform: '$(BuildPlatform)' |
|
configuration: '$(BuildConfiguration)' |
|
clean: true |
|
- task: Docker@1 |
|
displayName: 'Build an image' |
|
inputs: |
|
azureSubscriptionEndpoint: 'az-sub-here' |
|
azureContainerRegistry: acr-reg-here.azurecr.io |
|
dockerFile: FabrikamFiber.Web/Dockerfile |
|
- task: Docker@1 |
|
displayName: 'Push an image' |
|
inputs: |
|
azureSubscriptionEndpoint: 'az-sub-here' |
|
azureContainerRegistry: acr-reg-here.azurecr.io |
|
command: 'Push an image' |
|
- task: HelmInstaller@0 |
|
displayName: 'Install Helm 2.11.0' |
|
inputs: |
|
helmVersion: 2.11.0 |
|
- task: HelmDeploy@0 |
|
displayName: 'helm init' |
|
inputs: |
|
connectionType: 'Kubernetes Service Connection' |
|
kubernetesServiceConnection: kubecon2019 |
|
command: init |
|
arguments: '--client-only' |
|
- task: HelmDeploy@0 |
|
displayName: 'helm package' |
|
inputs: |
|
command: package |
|
chartPath: charts/fabrikamfiber |
|
- task: PublishBuildArtifacts@1 |
|
displayName: 'Publish Artifact: drop' |
|
|
|
### Yaml for Azure Pipelines is currently only supported for build. See below for markdown file for what is needed for release/deploy |