57 lines
1.7 KiB
YAML
57 lines
1.7 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
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
proxyImageName: 'e-suite.proxy'
|
|
|
|
${{ 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 Proxy Image
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
|
inputs:
|
|
command: build
|
|
repository: $(proxyImageName)
|
|
Dockerfile: Dockerfile
|
|
containerRegistry: |
|
|
$(containerRegistry)
|
|
tags: |
|
|
$(Build.BuildNumber)
|
|
|
|
- task: Docker@2
|
|
displayName: Push e-suite Proxy Image
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
|
inputs:
|
|
command: push
|
|
repository: $(proxyImageName)
|
|
containerRegistry: |
|
|
$(containerRegistry)
|
|
tags: |
|
|
$(Build.BuildNumber)
|