Search code examples
visual-studiodeploymentconfigurationappveyor

Is it possible to have multiple appveyor.yml configurations?


In our project repository we have an appveyor.yml which is setup for our .NET web applications (with things like assembly patching, nuget restore, etc.). If everything succeeds, our application is deployed to a staging and production environment. The .NET solution is located in repo/src/.

In the same repository we also create our HTML templates located in repo/frontend/. We would like to do a deploy of these HTML-files to a FTP host. This Frontend configuration should be run before the other configurations, but logically fails on assembly_info and nuget restore when no .NET solution is created.

Is it possible to create an appveyor configuration which can deploy our Frontend configuration to FTP and optionally continue with the Debug and Release configurations when a .NET solution is available?

Our configuration file this far:

version: 1.0.0.{build}

branches:
  only:
  - develop
  - /release\/\d+.\d+.\d+/
  - master

image: Visual Studio 2015

matrix:
  fast_finish: true     # set this flag to immediately finish build once one of the jobs fails.
  allow_failures:
    - platform: x86
      configuration: Debug
    - platform: x86
      configuration: Release

assembly_info:
  patch: true
  file: AssemblyInfo.*
  assembly_version: "{version}"
  assembly_file_version: "{version}"
  assembly_informational_version: "{version}"

nuget:
  account_feed: true

configuration:
  - Frontend
  - Debug
  - Release

build:
  publish_wap: true
  verbosity: minimal

before_build:
  - cmd: nuget restore src\ProjectName.Web.sln

test: off

artifacts:
  - path: frontend/dist/
    name: frontenddist

deploy:
  - provider: FTP
    host: 0.0.0.0
    protocol: ftp
    username: username
    password:
      secure: password
    folder: frontend-test
    application: frontenddist
    beta: true
    on:
      branch: develop
      configuration: frontend
  - provider: Environment
    name: ProjectName.Development
    remove_files: true
    on:
      branch: develop
      configuration: debug
  - provider: Environment
    name: ProjectName.Production
    remove_files: false
    on:
      branch: master
      configuration: release

notifications:
  - provider: Slack
    incoming_webhook: # removed for stackoverflow example
    on_build_success: true
    on_build_failure: true
    on_build_status_changed: false

Solution

  • Answer in AppVeyor forum discussion