LSTANCZYK
10/31/2014 - 9:43 PM

appveyor.yml

# Notes:
#   - Minimal appveyor.yml file is an empty file. All sections are optional.
#   - Indent each level of configuration with 2 spaces. Do not use tabs!
#   - All section names are case-sensitive.
#   - Section names should be unique on each level.

#---------------------------------#
#      general configuration      #
#---------------------------------#

# version format
version: 1.0.{build}

# branches to build
branches:
  # whitelist
  only:
    - master
    - production

  # blacklist
  except:
    - gh-pages

#---------------------------------#
#    environment configuration    #
#---------------------------------#

# Operating system (build VM template)
os: Windows Server 2012

# scripts that are called at very beginning, before repo cloning
init:
  - git config --global core.autocrlf input

# clone directory
clone_folder: c:\projects\myproject

# setting up etc\hosts file
hosts:
  queue-server: 127.0.0.1
  db.server.com: 127.0.0.2

# environment variables
environment:
  my_var1: value1
  my_var2: value2
  # this is how to set encrypted variable. Go to "Encrypt data" page in account menu to encrypt data.
  my_secure_var1:
    secure: FW3tJ3fMncxvs58/ifSP7w==

# environment:
#  global:
#    connection_string: server=12;password=13;
#    service_url: https://127.0.0.1:8090
#
#  matrix:
#  - db: mysql
#    provider: mysql
#
#  - db: mssql
#    provider: mssql
#    password:
#      secure: $#(JFDA)jQ@#$

# this is how to allow failing jobs in the matrix
matrix:
  allow_failures:
    - platform: x86
      configuration: Debug
    - platform: x64
      configuration: Release

# enable service required for build/tests
services:
  - mssql2012sp1        # start SQL Server 2012 SP1 Express
  - mssql2012sp1rs      # start SQL Server 2012 SP1 Express and Reporting Services
  - mssql2008r2sp2      # start SQL Server 2008 R2 SP2 Express
  - mssql2008r2sp2rs    # start SQL Server 2008 R2 SP2 Express and Reporting Services
  - iis                 # start IIS
  - msmq                # start Queuing services

# scripts that run after cloning repository
install:
  # by default, all script lines are interpreted as batch
  - echo This is batch
  # to run script as a PowerShell command prepend it with ps:
  - ps: Write-Host 'This is PowerShell'
  # batch commands start from cmd:
  - cmd: echo This is batch again
  - cmd: set MY_VAR=12345

# enable patching of AssemblyInfo.* files
assembly_info:
  patch: true
  file: AssemblyInfo.*
  assembly_version: "2.2.{build}"
  assembly_file_version: "{version}"
  assembly_informational_version: "{version}"

#---------------------------------#
#       build configuration       #
#---------------------------------#

# build platform, i.e. x86, x64, AnyCPU. This setting is optional.
platform: x86

# to add several platforms to build matrix:
#platform:
#  - x86
#  - AnyCPU

# build Configuration, i.e. Debug, Release, etc.
configuration: Debug

# to add several configurations to build matrix:
#configuration:
#  - Debug
#  - Release

build:
  project: MyTestAzureCS.sln      # path to Visual Studio solution or project
  publish_wap: true               # package Web Application Projects (WAP) for Web Deploy
  publish_wap_xcopy: true         # package Web Application Projects (WAP) for XCopy deployment
  publish_azure: true             # package Azure Cloud Service projects and push to artifacts
  publish_nuget: true             # package projects with .nuspec files and push to artifacts

  # MSBuild verbosity level
  verbosity: quiet|minimal|normal|detailed


# scripts to run before build
before_build:

# scripts to run after build
after_build:

# to run your custom scripts instead of automatic MSBuild
build_script:

# to disable automatic builds
#build: off

#---------------------------------#
#       tests configuration       #
#---------------------------------#

test:
  assemblies:
    - asm1.dll
    - asm2.dll

  categories:
    - UI
    - E2E

# to run tests from different categories as separate jobs in parallel
#test:
#  categories:
#    - A            # A category common for all jobs
#    - [UI]         # 1st job
#    - [DAL, BL]    # 2nd job

# scripts to run before tests
before_test:
  - echo script1
  - ps: Write-Host "script1"

# scripts to run after tests
after_test:

# to run your custom scripts instead of automatic tests
test_script:
  - echo This is my custom test script

# to disable automatic tests 
#test: off


#---------------------------------#
#      artifacts configuration    #
#---------------------------------#

artifacts:

  # pushing a single file
  - path: test.zip

  # pushing a single file with environment variable in path and "Deployment name" specified
  - path: MyProject\bin\$(configuration)
    name: myapp

  # pushing entire folder as a zip archive
  - path: logs

  # pushing all *.nupkg files in directory
  - path: out\*.nupkg


#---------------------------------#
#     deployment configuration    #
#---------------------------------#

# providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment
# provider name are case-sensitive!
deploy:
  - provider: FTP
    username: admin
    password: psw

  - provider: WebDeploy
    url: http://www.deploy.com/myendpoint
    on:
      branch: release
      platform: x86
      configuration: debug

  - provider: Environment
    name: staging
    on:
      branch: staging
      environment:
      var1: value1
      var2: value2

# scripts to run before deployment
before_deploy:

# scripts to run after deployment
after_deploy:

# to run your custom scripts instead of provider deployments
deploy_script:

# to disable deployment
#deploy: off

#---------------------------------#
#        global handlers          #
#---------------------------------#

# on successful build
on_success:
  - do something

# on build failure
on_failure:
  - do something

# webhooks
notifications:
  webhooks:
    - url: http://www.myhook.com
      events: build_success
    - url: http://www.myhook2.com
      events: [build_success, deployment_success]