# .NET Desktop
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

name: Dev.$(Date:yyyyMMdd).$(Rev:.r)

variables:
  solution: 'DevAudit.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'RuntimeDebug'

trigger:
- v3.x

jobs:
- job: Windows
  pool:
    vmImage: 'VS2017-Win2016'
  steps:
  - task: NuGetToolInstaller@0
  - task: NuGetCommand@2
    inputs:
      restoreSolution: '$(solution)'
      feedsToUse: 'config'
      nugetConfigPath: 'NuGet.Config'

  - task: VSBuild@1
    inputs:
      solution: '$(solution)'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'

  - task: VSTest@2
    inputs:
      testAssemblyVer2: '$(Build.SourcesDirectory)/DevAudit.Tests/bin/Debug/DevAudit.Tests.dll'
      testRunTitle: 'Windows xUnit Tests'
  
- job: Linux
  pool:
    vmImage: 'ubuntu-16.04'
  steps:
  - script: $(Build.SourcesDirectory)/build.sh
  - task: VSTest@2
    inputs:
      testAssemblyVer2: '$(Build.SourcesDirectory)/DevAudit.Tests/bin/Debug/DevAudit.Tests.dll'
      testRunTitle: 'Windows xUnit Tests'
  - script: docker build -t $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG .
  - script: docker login -u $DOCKERUSERID -p $DOCKERUSERPASS
  - script: docker push $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG
# .NET Desktop
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

name: Dev.$(Date:yyyyMMdd).$(Rev:.r)

variables:
  solution: 'DevAudit.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'RuntimeDebug'

trigger:
- v3.x

jobs:
- job: Windows
  pool:
    vmImage: 'VS2017-Win2016'
  steps:
  - task: NuGetToolInstaller@0
  - task: NuGetCommand@2
    inputs:
      restoreSolution: '$(solution)'
      feedsToUse: 'config'
      nugetConfigPath: 'NuGet.Config'

  - task: VSBuild@1
    inputs:
      solution: '$(solution)'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'

  - task: VSTest@2
    inputs:
      testAssemblyVer2: '$(Build.SourcesDirectory)/DevAudit.Tests/bin/Debug/DevAudit.Tests.dll'
      testRunTitle: 'Windows xUnit Tests'
  
- job: Linux
  pool:
    vmImage: 'ubuntu-16.04'
  steps:
  - script: $(Build.SourcesDirectory)/build.sh
  - script: docker build -t $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG .
  - script: docker login -u $DOCKERUSERID -p $DOCKERUSERPASS
  - script: docker push $DOCKERORGID/$DOCKERIMAGE:$DOCKERTAG
Remove VSTest step from Linux job.
Remove VSTest step from Linux job. [skip ci]