Build not triggered on regular git merge

We’ve been using Gitlab CI for over a year, but recently we’ve been having problems with builds not triggering.

The environment:

  • We have three long-lived branches, master, develop (“release”), and preview
  • Gitlab and CI are running on Linux
  • Gitlab 8.12

The build is correctly triggered when:

  • Someone commits directly to a long-lived branch.

The build should be triggered – but is not – when:

  • Someone does a git merge from a feature branch or a git flow feature finish.
  • Someone does a git merge from develop to master, or git flow release finish.

This behavior started recently, around the time we did an upgrade of Gitlab.

Here’s an example of our gitlab-ci.yml:

#
# Deploy and build all the things!
#
#
stages:
  - bootstrap
  - build
  - deploy

job_preview_bootstrap:
  tags:
    - host02
  stage: bootstrap
  script:
    # Bootstrap the git repository
    - "ansible localhost -m git -a \"repo=$CI_BUILD_REPO dest=~/git version=preview update=yes force=yes accept_hostkey=yes\""
  only:
    - preview

job_release_bootstrap:
  tags:
    - host02
  stage: bootstrap
  script:
    # Bootstrap the git repository
    - "ansible localhost -m git -a \"repo=$CI_BUILD_REPO dest=~/git version=develop update=yes force=yes accept_hostkey=yes\""
  except:
    - preview
    - master


job_live_bootstrap:
  tags:
    - live
  stage: bootstrap
  script:
    # Bootstrap the git repository
    - "ansible localhost -m git -a \"repo=$CI_BUILD_REPO dest=~/newten7/git version=master update=yes force=yes accept_hostkey=yes\""
  only:
      - master