Conditional configuration based on commit message?

v0idnull's Avatar

v0idnull

20 May, 2018 03:46 AM

I would like to always test, but only deploy if commit message contains "[deploy]" in it.

The documentation isn't very clear to me. Does commit message filtering affect the entire build? If not, how would I write the configuration to meet the requirement.

If so, is there some way where I can do something like always run tests, but only deploy if commit message contains "[deploy]" in it?

thanks in advance

  1. Support Staff 1 Posted by Ilya Finkelshte... on 21 May, 2018 06:33 PM

    Ilya Finkelshteyn's Avatar

    Your assumption is correct, commit filtering affects entire build. Please check this YAML sample on how to make it conditionally for deployment only.

    install:
    - ps: if ($env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[deploy]")) {$env:RUN_DEPLOYMENT = "true"}
    deploy:
    - provider: <provider_name>
      <provider_settings>
      on:
        RUN_DEPLOYMENT: true
    

    The same can be done with UI.

    More details on conditional deployment here.

    You can use APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED environment variable if your keyword is after line break in commit message (can happen with multiple squashed commits).

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

 

18 Aug, 2018 11:54 AM
18 Aug, 2018 12:13 AM
17 Aug, 2018 06:02 PM
17 Aug, 2018 04:26 PM
17 Aug, 2018 04:04 PM
17 Aug, 2018 06:31 AM