webui/azure-pipelines.yml
2026-01-20 21:48:51 +00:00

54 lines
1.6 KiB
YAML

# 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: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)$(postfix)$(branchName) # NOTE: rev resets when the default retention period expires
trigger:
branches:
include:
- '*'
pool:
vmImage: ubuntu-latest # ubuntu-latest - set to windows-latest or another Windows vmImage for Windows builds
variables:
containerRegistry: esuite.azurecr.io
imageName: 'e-Suite.webui'
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
branchName: ''
${{ elseif startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: $[ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), '/', '-' ) ]
${{ elseif startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $[ replace(replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', ''), '/', '-' ) ]
${{ if eq(variables['branchName'], '') }}:
postfix: ''
${{ else }}:
postfix: '-'
steps:
- task: Docker@2
displayName: Build e-suite Web UI Image
inputs:
repository: $(imageName)
command: build
Dockerfile: Dockerfile
containerRegistry: |
$(containerRegistry)
tags: |
$(Build.BuildNumber)
- task: Docker@2
displayName: Push e-suite Web UI Image
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
containerRegistry: |
$(containerRegistry)
repository: $(imageName)
command: push
tags: |
$(Build.BuildNumber)