Having issues with Only_commits

chris.reeder's Avatar

chris.reeder

13 Jun, 2018 07:56 PM

Can't seem to get only_commits to work correctly and wondering if there is something I'm doing wrong. Here is my yml:

version: "1.0.0.{build}"

environment:
  nodejs_version: "8"
  live_key:
    secure: q5+GzmaU0QfBbwD2W0VIyhwwyR3GFJuHgd5sPsxlTRcvSZUMwbXRsRyPkbEXkFOwsX9PFLUFxnqyWDzVT/S52UhWocf9l5d6ejY3BFidjJde54HzaVhAXzqIqZmEYxBL


install:
  - ps: Install-Product node $env:nodejs_version
  - ps: Install-Module -Name AzureTableEntity
  - npm install

branches:
 only:
   - /stage\/.+/
   - /live\/.+/

for:
- 
  only_commits:
    files:
      - 4tjs/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs1/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs1

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs2/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs2

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs3/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs3

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs4/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs4

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs5/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs5

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs6/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs6

  deploy_script:
    - ps: .\deploy\Deploy.ps1
- 
  only_commits:
    files:
      - 4tjs7/config/*

  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs7

  deploy_script:
    - ps: .\deploy\Deploy.ps1
-
  before_build:
    - ps: .\deploy\FileBranchSiteAlias.ps1 4tjs1

# This is common fof all containers

build_script:
    - npm run build-%Container%

test_script:
  - npm run test-%Container%

after_build:
- ps: .\deploy\PackageBuild.ps1 %Container%

It works if I use just the only_commits but when I stick it in a for: it doesn't seem to work.

  1. 1 Posted by chris.reeder on 13 Jun, 2018 10:56 PM

    chris.reeder's Avatar

    Anybody there? Still having issues. So I tried to make several different yml files as well but then they all fire like only_commit is not filtering? Is there someway I can just filter with ps to init a build. Is there some variable I can hit which gives me the files that I can filter off?

    Chris

  2. 2 Posted by chris.reeder on 13 Jun, 2018 11:55 PM

    chris.reeder's Avatar

    nm

  3. Support Staff 3 Posted by Owen McDonnell on 14 Jun, 2018 12:44 AM

    Owen McDonnell's Avatar

    The for: node is used for sharing common configuration between branches or configuring specific builds in a matrix, but not for commit filtering.
    Just to clarify, in your scenario, you have one branch that contains all those config paths 4tjs/config, 4tjs1/config etc. and you want to run a different script based on changes within the same branch to those specific files?

  4. Ilya Finkelshteyn closed this discussion on 31 Aug, 2018 07:53 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