mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
192 lines
7.2 KiB
YAML
192 lines
7.2 KiB
YAML
name: $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- source
|
|
paths:
|
|
include:
|
|
- src
|
|
|
|
pool:
|
|
# vmImage: windows-latest
|
|
demands: InnoSetup
|
|
|
|
resources:
|
|
repositories:
|
|
- repository: GitHubRepo
|
|
type: github
|
|
endpoint: Bletch1971
|
|
name: Bletch1971/ServerManagers
|
|
ref: refs/heads/master
|
|
|
|
variables:
|
|
- name: ApplicationName
|
|
value: $(Build.DefinitionName)
|
|
- name: SolutionFile
|
|
value: 'src/Server-Managers.sln'
|
|
- name: ProjectFile
|
|
value: 'src/$(ApplicationName)/$(ApplicationName).csproj'
|
|
- name: PublishFolder
|
|
value: publish
|
|
|
|
stages:
|
|
- template: azure-pipelines-build.yml@self
|
|
parameters:
|
|
ApplicationName: $(ApplicationName)
|
|
SolutionFile: $(SolutionFile)
|
|
ProjectFile: $(ProjectFile)
|
|
PublishFolder: $(PublishFolder)
|
|
|
|
- stage: deployBeta
|
|
displayName: Beta
|
|
lockBehavior: runLatest
|
|
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/source'))
|
|
dependsOn:
|
|
- build
|
|
|
|
jobs:
|
|
- deployment: deployBeta
|
|
displayName: Deploy Beta
|
|
environment: github-servermanager-beta
|
|
|
|
strategy:
|
|
runOnce:
|
|
deploy:
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: Pre Clean-up Agent Folders
|
|
env:
|
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
|
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
|
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_SOURCESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
pwsh: true
|
|
|
|
- task: PowerShell@2
|
|
displayName: Output Environment Variables
|
|
condition: contains(variables['system.debug'], 'true')
|
|
inputs:
|
|
targetType: inline
|
|
script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String'
|
|
pwsh: true
|
|
|
|
- checkout: GitHubRepo
|
|
|
|
- task: PowerShell@2
|
|
displayName: Post Clean-up Agent Folders
|
|
condition: always()
|
|
env:
|
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
|
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
|
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
|
BUILD_PUBLISHDIRECTORY: "$(Agent.BuildDirectory)/$(PublishFolder)"
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_SOURCESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_PUBLISHDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
pwsh: true
|
|
|
|
- stage: deployRelease
|
|
displayName: Production
|
|
lockBehavior: runLatest
|
|
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/source'))
|
|
dependsOn:
|
|
- deployBeta
|
|
|
|
jobs:
|
|
- deployment: deployRelease
|
|
displayName: Deploy Production
|
|
environment: github-servermanager-release
|
|
|
|
strategy:
|
|
runOnce:
|
|
deploy:
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: Pre Clean-up Agent Folders
|
|
condition: always()
|
|
env:
|
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
|
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
|
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_SOURCESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
pwsh: true
|
|
|
|
- task: PowerShell@2
|
|
displayName: Output Environment Variables
|
|
condition: contains(variables['system.debug'], 'true')
|
|
inputs:
|
|
targetType: inline
|
|
script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String'
|
|
pwsh: true
|
|
|
|
- checkout: GitHubRepo
|
|
|
|
- task: PowerShell@2
|
|
displayName: Post Clean-up Agent Folders
|
|
condition: always()
|
|
env:
|
|
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
|
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
|
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
|
BUILD_PUBLISHDIRECTORY: "$(Agent.BuildDirectory)/$(PublishFolder)"
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_SOURCESDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Test-Path $env:BUILD_PUBLISHDIRECTORY) {
|
|
Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
pwsh: true
|