Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.7 kB
1
Indexable
Never
- task: NuGetToolInstaller@1
  displayName: 'NuGet tool installer'

- task: NuGetCommand@2
  displayName: 'NuGet restore packages'
  inputs:
    command: 'restore'
    restoreSolution: '$(solution)'
    feedsToUse: 'config'
    nugetConfigPath: 'NuGet.config'

- task: DotNetCoreCLI@2
  displayName: 'Build' 
  inputs:
    command: 'publish'
    publishWebProjects: false
    projects: '$(project)'
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: false

- task: AzureAppServiceManage@0
  displayName: 'Stop Azure App Service'
  inputs:
    azureSubscription: '$(subscription)'
    Action: 'Stop Azure App Service'
    WebAppName: '$(appName)'

- task: PublishBuildArtifacts@1
  displayName: 'Publish build artifacts'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName:  '$(projectName)'
    publishLocation: 'Container'

- powershell: Start-Sleep -Seconds 15
  displayName: 'Delay to ensure files are not locked (15 seconds)'

- task: FtpUpload@2
  displayName: 'Ftp Upload'
  inputs:
    credentialsOption: 'inputs'
    serverUrl: '$(ftpURL)'
    username: '$(userFTP)'
    password:  '$(passwordFTP)'
    rootDirectory: '$(Build.ArtifactStagingDirectory)/$(projectName)'
    filePatterns: '**'
    remoteDirectory: '/site/wwwroot'
    clean: true
    cleanContents: true
    preservePaths: true
    trustSSL: false
    
- task: AzureAppServiceManage@0
  displayName: 'Start Azure App Service'
  inputs:
    azureSubscription: '$(subscription)'
    Action: 'Start Azure App Service'
    WebAppName: '$(appName)'
Leave a Comment