name: $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)

trigger:
  branches:
    include:
    - source
  paths:
    include:
    - src
pr: none

pool:
  name: Default
  demands: InnoSetup
#  vmImage: windows-latest

resources:
  repositories:
  - repository: MasterRepo
    type: GitHub
    endpoint: Bletch1971
    name: Bletch1971/ServerManagers

variables:
- name: ApplicationName
  value: $(Build.DefinitionName)
- name: SolutionFile
  value: 'src/Server-Managers.sln'
- name: ProjectFile
  value: 'src/$(ApplicationName)/$(ApplicationName).csproj'

stages:
- template: azure-pipelines-servermanagers-build.yml
  parameters:
    ApplicationName: $(ApplicationName)
    SolutionFile: $(SolutionFile)
    ProjectFile: $(ProjectFile)
    BuildConfiguration: $(BuildConfiguration)
    BuildPlatform: $(BuildPlatform)
    PublishFolder: $(PublishFolder)

- template: azure-pipelines-servermanagers-deploy.yml
  parameters:
    DeploymentType: Beta
    DependsOn: build
    ApplicationName: $(ApplicationName)
    PublishFolder: $(PublishFolder)
    RepositoryFolder: $(RepositoryFolderBeta)
    GitEmail: $(GitEmail)
    GitUsername: $(GitUsername)

- template: azure-pipelines-servermanagers-deploy.yml
  parameters:
    DeploymentType: Production
    DependsOn: Beta
    ApplicationName: $(ApplicationName)
    PublishFolder: $(PublishFolder)
    RepositoryFolder: $(RepositoryFolderProduction)
    GitEmail: $(GitEmail)
    GitUsername: $(GitUsername)
