Except `gh-pages` branch

Yury's Avatar

Yury

21 Mar, 2018 10:18 PM

First of all, I would like to apologize in advance if my question is foolish, I'm a newcomer to CI and all this stuff.

I wanted to configure multiple per-branch configurations in that way:
* just a regular build for all branches except master
* release build for master branch and publish artifacts
* don't build gh-pages branch at all

I used this manual and managed to create appveyor.yml which satisfying first two conditions - link to github file.

Unfortunately, the third condition is unfulfilled - gh-pages branch still building - this build for instance.

I have found this line: gh-pages branch is always excluded unless explicitly added in “only” list. in doc and check one more time that I don't have this branch in "only" list.

I've found that build script is different from my setup in appveyor.yml, so then I thought that something wrong in regular settings (on site) and try to add gh-pages branch to excluded there: except
but the branch still builds.

Thank you in advance!

  1. Support Staff 1 Posted by Ilya Finkelshte... on 21 Mar, 2018 11:24 PM

    Ilya Finkelshteyn's Avatar

    No need to apologize, this part is really complicated :) gh-pages excluded if you have branch filtering. But in your configuration there are multiple configuration, and not branch filtering. UI settings from screenshot does not apply as YAML takes over UI.

    Please try this YAML. It has default config for all branches, special one for master and gh-pages are filtered out.

    version: 1.0.{build}
    image: Visual Studio 2017
    
    branches:
      except:
      - gh-pages
    before_build:
      - pwsh: dotnet --version
    build_script:
      - pwsh: dotnet build ./src/CityMap.csproj -c Release
    
    for:
    - 
      branches:
        only:
        - master
      build_script:
        - pwsh: dotnet build ./src/CityMap.csproj -c Release
        - pwsh: dotnet publish ./src/CityMap.csproj -c Release -r win10-x64
        - pwsh: dotnet publish ./src/CityMap.csproj -c Release -r linux-x64
        - pwsh: dotnet publish ./src/CityMap.csproj -c Release -r osx-x64    
      artifacts:
      - path: 'src\bin\Release\netcoreapp2.0\win10-x64\publish'
        name: win10-x64
      - path: 'src\bin\Release\netcoreapp2.0\linux-x64\publish'
        name: linux-x64
      - path: 'src\bin\Release\netcoreapp2.0\osx-x64\publish'
        name: osx-x64
    

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