

# 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

trigger:
- test

pool:
  name: KUK-CLOUD-VM
  demands: 
  - agent.name -equals KUKServicesAgent

variables:
- name: backupFolder
  value: 'E://backup'
- name: projectFolder
  value: 'E://WebRoot//kuk'
- name: configFolder
  value: 'E://config'

steps:
- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: $(projectFolder)
    includeRootFolder: true
    archiveType: 'zip'
    archiveFile: '$(backupFolder)/KUK_$(Build.BuildId).zip'
    replaceExistingArchive: true
  displayName: archiveAndBackup
- task: CopyFiles@2
  inputs:
    SourceFolder: '$(Build.SourcesDirectory)'
    Contents: '**'
    TargetFolder: $(projectFolder)
    CleanTargetFolder: false
    OverWrite: true
  displayName: Place the files in project folder

- task: CopyFiles@2
  inputs:
    SourceFolder: '$(configFolder)'
    Contents: '**'
    TargetFolder: '$(projectFolder)'
    OverWrite: true
  displayName: Place config files in project folder
          
  