当前位置:   article > 正文

Azure Pipelines - Dotnet 通过Git提交,自动编译、发布、部署到目标服务器IIS站点 azure-pipelines.yml_azure devops发布到目标服务器

azure devops发布到目标服务器

这里只贴一个配置azure-pipelines.yml

trigger:
- '*'

pool:
  vmImage: ubuntu-latest

variables:
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: 'Use .NET SDK 6.x'
  inputs:
    packageType: sdk
    version: '6.x'



# 还原
- task: DotNetCoreCLI@2
  displayName: 'Restore project dependencies'
  inputs:
    command: 'restore'
    projects: '**/*.csproj'

# 编译
- task: DotNetCoreCLI@2
  displayName: 'Build the project - Release'
  inputs:
    command: 'build'
    arguments: '--no-restore --configuration Release'
    projects: '**/*.csproj'

# 发布
- task: DotNetCoreCLI@2
  displayName: 'Publish the project - Release'
  inputs:
    command: 'publish'
    projects: '**/*.csproj'
    publishWebProjects: true
    # arguments: '--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)/Release'
    arguments: '--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: true
# - task: PublishPipelineArtifact@1
#   inputs:
#     targetPath: '$(Build.ArtifactStagingDirectory)' 
#     artifactName: 'TestWebSet'

- task: FtpUpload@2
  displayName: "FTP Upload"
  inputs:
    credentialsOption: 'inputs'
    serverUrl: 'ftp://目标服务器Host'
    username: '用户名'
    password: '密码'
    rootDirectory: '$(Build.ArtifactStagingDirectory)/'
    filePatterns: '**'
    remoteDirectory: '/TestWebSet/Artifacts/'
    clean: true
    cleanContents: true
    preservePaths: true
    trustSSL: false

- task: JenkinsQueueJob@2
  inputs:
    serverEndpoint: 'JenkinsServer'
    jobName: '脚本名'
    captureConsole: true
- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'
  condition: succeeded()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号