Azure DevOps 发布.Net项目到Windows IIS站点之pubxml

通过VS中我们配置的pubxml进行发布

trigger:
- master

pool:
  vmImage: 'windows-2022'

variables:
- group: GeexPublish
- name: my-user-variable
  value: $[variables.UserName] # uses runtime expression
- name: my-passed-variable
  value: $[variables.PassWord] # uses runtime expression
- name: buildConfiguration
  value: 'Release'
- name: publishFolder
  value: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId)'
- name: solution
  value: '**/Platform.Client.csproj'

steps:
- script: echo $(UserName) # uses macro syntax
- script: echo $(my-passed-variable) 

- task: DotNetCoreCLI@2
  displayName: 'Restore dependencies'
  inputs:
    command: 'restore'
    projects: '$(solution)'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Publish to IIS'
  inputs:
    command: 'publish'
    arguments: '--configuration Release /p:UserName=$(my-user-variable) /p:Password=$(my-passed-variable) /p:PublishProfile=xxxxxxx.pubxml'
    workingDirectory: './Platform.Client'
posted @ 2023-10-27 13:58  初久的私房菜  阅读(1711)  评论(0编辑  收藏  举报
作者:初久的私房菜
好好学习,天天向上
返回顶部小火箭
好友榜:
如果愿意,把你的博客地址放这里
张弛:https://blog.zhangchi.fun/