AppVeyor CI - Azure应用服务多环境部署

问题描述 投票:0回答:1

我有一个Asp.Net MVC项目,它通过AppVeyor部署到Azure应用服务,其appveyor.yml文件配置为将GitHub提交部署到生产和暂存。

配置是 -

  • 主分支,使用发布配置。
  • 暂存分支,使用暂存配置。

分段部署可以毫无问题地构建和部署,但是,分段部署仍然以“Release”配置为目标,尽管它已设置为Staging分支的“Staging”。我可以看到这一点,当我登录到登台时,它指向Staging Azure SQL数据库。

本地测试

我已经在Staging配置中进行了本地测试,它在这方面起作用。

我假设appveyor.yml文件配置不正确,因此AppVeyor没有获取Staging配置?

version: 1.0.{build}

build_script:
  - ps: .\build.cmd CreateNuGet

nuget:
  account_feed: true

artifacts:
  - path: output\*.*

test: off

for:
# configuration for "master" branch
# build in Release mode and deploy to the Azure prod environment
-
  branches:
    only:
      - master
  configuration: Release

  deploy:
    provider: WebDeploy
    server: [removed for brevity]
    website: [removed for brevity]
    username: [removed for brevity]
    password: [removed for brevity]
    ntlm: false
    remove_files: true
    app_offline: false

# configuration for "staging" branch
# build in Staging mode and deploy to the Azure staging environment
-
  branches:
    only:
      - staging
  configuration: Staging

  deploy:
    provider: WebDeploy
    server: [removed for brevity]
    website: [removed for brevity]
    username: [removed for brevity]
    password: [removed for brevity]
    ntlm: false
    remove_files: true
    app_offline: false

# "fall back" configuration for all other branches
# no "branches" section defined
# do not deploy at all
configuration: Debug
asp.net-mvc deployment continuous-integration appveyor azure-app-service-envrmnt
1个回答
0
投票

我怀疑“后退”配置会覆盖先前设置的配置。通过删除它(或可能将其移动到文件的顶部),您将获得所需的结果。

© www.soinside.com 2019 - 2024. All rights reserved.