Selective build triggering on push

hargitomi97's Avatar

hargitomi97

30 Nov, 2018 09:16 PM

Hello!

When I commit and push, I would like appveyor to start building my project and that works just fine.
However after that, in the on_success tag, I would like to push a newly generated file to my github repo.

on_success:
...
- git push

This time, I do not want a new build to start. Is there way a to manage this? I could only find a solution where no build event triggers when I push, but that is not good for me.
Thank you very much.

  1. Support Staff 1 Posted by Owen McDonnell on 30 Nov, 2018 10:45 PM

    Owen McDonnell's Avatar

    You can take a look at commit filtering based on files here.

  2. 2 Posted by hargitomi97 on 02 Dec, 2018 06:48 AM

    hargitomi97's Avatar

    I use the following filter:

    skip_commits:
        message: /PDF/
    ...
    on_success:
    ...
    - git diff-index --quiet HEAD || git commit -am "PDF"
    - git push

    This push still triggers a new build, I might have been missing something.

  3. Support Staff 3 Posted by Owen McDonnell on 03 Dec, 2018 05:57 AM

    Owen McDonnell's Avatar

    Please post the full config file and a link to the build.

  4. 4 Posted by hargitomi97 on 04 Dec, 2018 12:08 PM

    hargitomi97's Avatar

    Thank you for your help, here is my config file (bit long):

    version: 0.1.{build}
    branches:
      only:
      - master
    image: Visual Studio 2017
    configuration: Release
    #assembly_info:
    # patch: true
    # file: '**\AssemblyInfo.*'
    # assembly_version: '{version}'
    # assembly_file_version: '{version}'
    # assembly_informational_version: '{version}'
    dotnet_csproj:
      patch: true
      file: '**\*.csproj'
      version: '{version}'
      package_version: '{version}'
      assembly_version: '{version}'
      file_version: '{version}'

    environment:
      access_token:
       secure: NuXJPvfbtEJEsj358sMDapkR5DWHUt46ftc5sHll0zQkLMhc/N7zVGpLYZc0wCPC
      MYGET_KEY:
        secure: b+lrnLDBMVds0RmnoyuVqVYz5sjgqSeY/AhWn+iTT7/+jaa4VaHihRpFaHWRs8AN
      NUGET_KEY:
        secure: GWychdaWwFZJHzYsFL1es67HqNEgirgT3iHeewQmNSFODWFEUzn4Eu5QT1XH5C8/
      
    skip_commits:
        message: /PDF/

    before_build:
    - cmd: nuget restore
    - choco install opencover.portable
    - choco install codecov
    - ps: Install-Product node 6
    - npm install -g github-wikito-converter
    - npm install -g html-pdf
    #after_build:
    #- cmd: dotnet pack -c Release src/SigStat.Common/SigStat.Common.csproj
    build:
      publish_nuget: true
      verbosity: normal
    deploy:
    - provider: NuGet
      server: https://www.myget.org/F/bencekovari/api/v2/package
      api_key:
       secure: Lt06yKCteORxJGN1HKZz3WbzQXLDHsRiuJCXTVKOM9DAAC7ZR/Lr9OI4BsOHrguh

    test_script:
    - OpenCover.Console.exe -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test \"test\SigStat.Common.Test\" --configuration Release" -filter:"+[SigStat.Common*]* -[SigStat.Common.Test*]*" -oldStyle -register:user
    - codecov -f "results.xml" -r "sigstat/sigstat"

    on_success:
    - git config --global credential.helper store
    - ps: Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
    - git config --global user.email "[email blocked]"
    - git config --global user.name "hargitomi97"
    - md C:\projects\wiki
    - cd C:\projects\wiki
    - git clone https://github.com/sigstat/sigstat.wiki.git
    - C:\projects\sigstat\docs\generator\MarkdownGenerator.exe C:\projects\sigstat\src\SigStat.Common\bin\Release\netstandard2.0\SigStat.Common.dll "C:\projects\wiki\SigStat.wiki"
    - echo All | xcopy C:\projects\sigstat\docs\md\_Sidebar.md C:\projects\wiki\SigStat.wiki
    - cd C:\projects\wiki\SigStat.wiki
    - git add -A
    - git diff-index --quiet HEAD || git commit -am "wiki"
    - git push
    - cd C:\projects\sigstat\docs
    - gwtc C:\projects\wiki\SigStat.wiki
    - html-pdf documentation.html documentation.pdf
    - rm documentation.html
    - git add .
    - git diff-index --quiet HEAD || git commit -am "PDF"
    - git push

    Link to the corresponding build: https://ci.appveyor.com/project/BenceKovari/sigstat/builds/20707173

  5. Support Staff 5 Posted by Owen McDonnell on 05 Dec, 2018 02:03 AM

    Owen McDonnell's Avatar

    Your project has been added as a generic git project and therefore cannot check out the appveyor.yml before the build to know if it should skip it.
    If you want to use this functionality you should create a repo on GitHub or Bitbucket as those are the two services for which this is supported as hinted at in the titile here.

  6. Ilya Finkelshteyn closed this discussion on 04 Feb, 2019 09:01 PM.

Comments are currently closed for this discussion. You can start a new one.

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

20 Mar, 2019 11:39 PM
20 Mar, 2019 09:03 PM
20 Mar, 2019 08:55 PM
20 Mar, 2019 08:48 PM
20 Mar, 2019 08:02 PM

 

20 Mar, 2019 07:14 PM
20 Mar, 2019 06:27 PM
20 Mar, 2019 04:02 PM
20 Mar, 2019 08:51 AM
19 Mar, 2019 06:21 PM
19 Mar, 2019 05:22 PM