Files
monorepo/LCU.API.Collections.CollectionsApi/azdo_pipelines/azure-k8s-pipeline.yaml
T
2026-04-08 10:11:47 -05:00

64 lines
2.0 KiB
YAML

parameters:
- name: target_environment
displayName: Target Environment
type: string
default: qa
values:
- qa
- uat
- prd
- name: k8s_namespace
displayName: K8s Namespace to deploy to
type: string
default: landmarkcu
values:
- landmarkcu
variables:
- template: ./config-files/${{ parameters.target_environment }}-pvars.yaml
- name: source_branch_name
value: $[replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), '/', '-')]
- name: docker_container_repository_name
value: landmarkcu/lcu.api.internal.collections-collections
resources:
repositories:
- repository: azdo_pipeline_templates
type: git
name: Infrastructure Platform/azdo-pipeline-templates
ref: main
stages:
# DOTNET BUILD AND NUGET PUSH
- template: dotnet-nuget-build-push.yaml@azdo_pipeline_templates
parameters:
azdo_agent_pool: $(pvar_azdo_agent_pool_nuget)
azure_artifacts_feed: 'LCU-Internal'
branches_to_push:
- develop
- master
# DOCKER BUILD AND PUSH
- template: docker-build-push.yaml@azdo_pipeline_templates
parameters:
azdo_agent_pool: $(pvar_azdo_agent_pool)
docker_registry_service_connection: $(pvar_docker_registry_service_connection)
docker_container_repository_name: $(docker_container_repository_name)
dockerfile_path: ./Dockerfile
docker_image_tags: |
build-$(Build.BuildId)
$(source_branch_name)
# K8S DEPLOY
- template: k8s-deploy.yaml@azdo_pipeline_templates
parameters:
dependsOn: CI
condition: or(eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'main'))
azdo_agent_pool: $(pvar_azdo_agent_pool)
kubectl_version: $(pvar_kubectl_version)
k8s_service_connection: $(pvar_k8s_service_connection)
k8s_namespace: ${{ parameters.k8s_namespace }}
k8s_kustomization_path: ./kustomize/overlays/${{ parameters.target_environment }}
docker_registry_service_connection: $(pvar_docker_registry_service_connection)
docker_image_to_deploy: $(docker_container_repository_name):build-$(Build.BuildId)