Is it possible to have multiple appveyor.yml configurations?

Ewout's Avatar

Ewout

09 Mar, 2017 12:58 PM

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: slack-hook
    on_build_success: true
    on_build_failure: true
    on_build_status_changed: false
  1. Support Staff 1 Posted by Ilya Finkelshte... on 09 Mar, 2017 07:20 PM

    Ilya Finkelshteyn's Avatar

    Hi Ewout,

    I would do the following:

    • Create separate AppVeyor projects for FrontEnd and BackEnd. You can target the same repository from different projects and use separate YAML files with custom name as described here
    • Make FrontEnd build call BackEnd build as on_success script from PowerShell using API. Here is PowerShell sample
    • You can run this start build script conditionally if BackEnd .NET solution is available. You can simple check it with test-path (if I understand what does 'available' means correctly).

    There are still few open questions common for this kind of chaining:

    • What kind of change should trigger FrontEnd build?
    • Should BackEnd build be triggered by some change or only by FrontEnd build?
    • Should FrontEnd build wait for BackEnd build to finish successfully and fail if BackEnd build is not happy?

    --ilya.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Oct, 2017 08:54 AM
18 Oct, 2017 08:21 AM
18 Oct, 2017 07:42 AM
17 Oct, 2017 07:36 PM
17 Oct, 2017 05:39 PM

 

17 Oct, 2017 04:29 PM
17 Oct, 2017 07:49 AM
16 Oct, 2017 11:38 PM
16 Oct, 2017 10:01 PM
16 Oct, 2017 08:25 AM
16 Oct, 2017 07:58 AM