Adding
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
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.memberpreferences-memberpreferences
|
||||
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'
|
||||
|
||||
# DACPAC BUILD AND PUSH
|
||||
- template: db-build-deploy.yaml@azdo_pipeline_templates
|
||||
parameters:
|
||||
azdo_agent_pool: $(pvar_azdo_agent_pool_db)
|
||||
azdo_deployment_environment: $(pvar_azdo_deployment_environment_db)
|
||||
sql_project_path: './LCU.API.Internal.MemberPreferencesApiSql/LCU.API.Internal.MemberPreferencesApiSql.sqlproj'
|
||||
built_sql_dacpac_file_path: './LCU.API.Internal.MemberPreferencesApiSql/bin/Release/LCU.API.Internal.MemberPreferencesApiSql.dacpac'
|
||||
name_of_artifact: LCU_API_Internal_MemberPreferencesApiSql_dacpac
|
||||
db_name: $(pvar_LCU_API_Internal_MemberPreferencesApiSql_db_name)
|
||||
sql_server_name: $(pvar_LCU_API_Internal_MemberPreferencesApiSql_sql_server_name)
|
||||
|
||||
# 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)
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
# Starter pipeline
|
||||
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
||||
# Add steps that build, run tests, deploy, and more:
|
||||
# https://aka.ms/yaml
|
||||
|
||||
name: 'LCU.API.Internal.MemberPreferencesApi.$(Build.SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)'
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- '*'
|
||||
|
||||
variables:
|
||||
- template: ./config-files/qa-pvars.yaml
|
||||
- name: docker_container_repository_name
|
||||
value: landmarkcu/member-preferences-api
|
||||
- name: buildConfiguration
|
||||
value: Release
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: azdo_pipeline_templates
|
||||
type: git
|
||||
name: Infrastructure Platform/azdo-pipeline-templates
|
||||
ref: main
|
||||
|
||||
stages:
|
||||
- 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.BuildId)
|
||||
latest
|
||||
|
||||
- stage: Build_and_publish_dacpac
|
||||
displayName: Build and Publish Nuget Dacpac
|
||||
pool:
|
||||
name: LCUOnPrem
|
||||
demands:
|
||||
- SqlPackage
|
||||
- MSBuild
|
||||
|
||||
jobs:
|
||||
- job: Build
|
||||
displayName: Build
|
||||
steps:
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: 'restore'
|
||||
feedsToUse: 'select'
|
||||
vstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: 'build'
|
||||
projects: '**/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Test
|
||||
inputs:
|
||||
command: test
|
||||
projects: '**/*Tests.csproj'
|
||||
arguments: '--configuration $(BuildConfiguration) --collect "Code coverage"'
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: Build sql project
|
||||
inputs:
|
||||
solution: './LCU.API.Internal.MemberPreferencesApiSql/LCU.API.Internal.MemberPreferencesApiSql.sqlproj'
|
||||
configuration: 'Release'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy dacpac to artifact staging directory
|
||||
inputs:
|
||||
SourceFolder: './LCU.API.Internal.MemberPreferencesApiSql/bin/$(BuildConfiguration)/'
|
||||
Contents: 'LCU.API.Internal.MemberPreferencesApiSql.dacpac'
|
||||
TargetFolder: '$(build.artifactstagingdirectory)'
|
||||
OverWrite: true
|
||||
|
||||
- task: NuGetCommand@2
|
||||
condition: and (succeeded(), eq(variables['Build.SourceBranchName'], 'main') )
|
||||
displayName: 'NuGet Push'
|
||||
inputs:
|
||||
command: 'push'
|
||||
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
|
||||
publishVstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
||||
allowPackageConflicts: true
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
condition: and (succeeded(), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'main')) )
|
||||
displayName: 'Publish Artifact: dist'
|
||||
inputs:
|
||||
PathtoPublish: '$(build.artifactstagingdirectory)'
|
||||
ArtifactName: 'dist'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
condition: and (succeeded(), eq(variables['Build.SourceBranchName'], 'main') )
|
||||
displayName: 'NuGet Push'
|
||||
inputs:
|
||||
command: 'push'
|
||||
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
|
||||
publishVstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
||||
allowPackageConflicts: true
|
||||
|
||||
|
||||
- stage: Publish
|
||||
displayName: Publish
|
||||
dependsOn: Build_and_publish_dacpac
|
||||
condition: or(eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'main'))
|
||||
jobs:
|
||||
- job: Publish
|
||||
displayName: Publish
|
||||
steps:
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'sed -i ''s/{{version}}/$(Build.BuildID)/g'' _deploy/base/Deployment.yaml'
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: './_deploy'
|
||||
artifact: 'overlay'
|
||||
publishLocation: 'pipeline'
|
||||
displayName: 'Publish Overlay Artifact'
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- '*'
|
||||
exclude:
|
||||
- 'main'
|
||||
- 'develop'
|
||||
extends:
|
||||
template: azure-k8s-pipeline.yaml
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- 'main'
|
||||
extends:
|
||||
template: azure-k8s-pipeline.yaml
|
||||
parameters:
|
||||
target_environment: prd
|
||||
k8s_namespace: landmarkcu
|
||||
@@ -0,0 +1,9 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- 'develop'
|
||||
extends:
|
||||
template: azure-k8s-pipeline.yaml
|
||||
parameters:
|
||||
target_environment: qa
|
||||
k8s_namespace: landmarkcu
|
||||
@@ -0,0 +1,9 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- 'main'
|
||||
extends:
|
||||
template: azure-k8s-pipeline.yaml
|
||||
parameters:
|
||||
target_environment: uat
|
||||
k8s_namespace: landmarkcu
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
variables:
|
||||
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-prd-lz-uscz
|
||||
pvar_docker_registry_service_connection: Docker Registry LMCU
|
||||
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-prd-aks-k8s-uscz
|
||||
pvar_kubectl_version: 1.25.9
|
||||
pvar_azdo_agent_pool_nuget: LCUOnPrem
|
||||
pvar_azdo_agent_pool_db: LCUOnPrem
|
||||
pvar_azdo_deployment_environment_db: DB-PRD
|
||||
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_db_name: MemberPreferences
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_sql_server_name: D1CLS01P
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
variables:
|
||||
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-qa-lz-uscz
|
||||
pvar_docker_registry_service_connection: Docker Registry LMCU
|
||||
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-qa-aks-k8s-uscz
|
||||
pvar_kubectl_version: 1.25.9
|
||||
pvar_azdo_agent_pool_nuget: LCUOnPrem
|
||||
pvar_azdo_agent_pool_db: LCUOnPrem
|
||||
pvar_azdo_deployment_environment_db: DB-QA
|
||||
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_db_name: MemberPreferences
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_sql_server_name: D1DTB01Q
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
variables:
|
||||
pvar_azdo_agent_pool: vmss-sub-df-lcu-apps-uat-lz-uscz
|
||||
pvar_docker_registry_service_connection: Docker Registry LMCU
|
||||
pvar_k8s_service_connection: svcon-sub-df-lcu-apps-uat-aks-k8s-uscz
|
||||
pvar_kubectl_version: 1.25.9
|
||||
pvar_azdo_agent_pool_nuget: LCUOnPrem
|
||||
pvar_azdo_agent_pool_db: LCUOnPrem
|
||||
pvar_azdo_deployment_environment_db: DB-UAT
|
||||
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_db_name: MemberPreferences
|
||||
pvar_LCU_API_Internal_MemberPreferencesApiSql_sql_server_name: D1CLS01U
|
||||
Reference in New Issue
Block a user