first commit

This commit is contained in:
Igor Kozlov
2025-12-21 00:24:31 +03:00
commit b91ca68b4d
1668 changed files with 156887 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
trigger:
branches:
include:
- test
- release
paths:
include:
- src/Monitoring/Monitoring.Web/*
variables:
- ${{ if eq(variables['Build.SourceBranchName'], 'test') }}:
- group: Test
- name: imageTag
value: "test"
- name: deployEnvironment
value: "Test"
- name: agentPool
value: "Fire Service Pool Agent"
- ${{ if eq(variables['Build.SourceBranchName'], 'release') }}:
- group: Prod
- name: imageTag
value: "release"
- name: deployEnvironment
value: "Prod"
- name: agentPool
value: "IBTests"
- name: versionTag
value: "1.0.$(Build.BuildId)"
stages:
- stage: Build
displayName: "Build frontend"
pool:
name: $(agentPool)
jobs:
- job: Build
displayName: "Build and push Docker images"
steps:
- task: Docker@2
displayName: "Build and push frontend image"
inputs:
command: "buildAndPush"
Dockerfile: "src/Monitoring/Monitoring.Web/Dockerfile"
repository: "$(REGISTRY_USERNAME)/$(MONITORING_FRONTEND_IMAGE_NAME)"
tags: |
$(imageTag)
$(versionTag)
buildContext: "src/Monitoring/Monitoring.Web"
containerRegistry: $(REGISTRY_NAME)
- stage: Deploy
displayName: "Deploy"
dependsOn:
- Build
pool:
name: $(agentPool)
jobs:
- deployment: Deploy
displayName: "Deploy"
environment: $(deployEnvironment)
strategy:
runOnce:
deploy:
steps:
- script: |
# Pull latest images
docker pull $(REGISTRY_ADDRESS)/$(REGISTRY_USERNAME)/$(MONITORING_FRONTEND_IMAGE_NAME):$(imageTag)
# Update services with new images
docker service update \
--image $(REGISTRY_ADDRESS)/$(REGISTRY_USERNAME)/$(MONITORING_FRONTEND_IMAGE_NAME):$(imageTag) \
--force \
$(MONITORING_FRONTEND_SERVICE_NAME)
displayName: "Update Docker services"