"Skipping a deployment with the script provider because this branch is not permitted" despite "on: all_branches: true"

Hi,

I’m trying to build 2 docker images, on :latest and one :git_tag and have configured 2 deployment “paths” for that … the master build and deploy (push to docker hub) seems to be working ok, however, when it’s meant to do the tag build, it keeps saying …

Skipping  a deployment with the script provider because this branch is not permitted: <git tag>

and then the build goes green … :expressionless:

I’ve tried various different ways, with and without setting branch config, etc. … all resulting in the same message …

here’s the current .travis.yml

language: go
go:
  - 1.11.x

branches:
  only:
  - /.*/

# addons:
#   apt:
#     packages:
#     - docker-ce

# sudo: required

services:
- docker

env:
  global:
    - GO111MODULE=on

jobs:
  include:
  # --------------------------------------------
  - stage: test
    skip_cleanup: true
    script: 
      - make test
  # --------------------------------------------
  - stage: build+push:latest
    if:
      tag IS NOT present
    before_deploy:
      - make build TAG=latest
      - make run TAG=latest CMD=version
    deploy:
      provider: script
      script: make push TAG=latest
    on:
      branch: master
  # --------------------------------------------
  - stage: build+push:tag
    if:
      tag IS present
    before_deploy:
      - make build TAG=$TRAVIS_TAG
      - make run TAG=$TRAVIS_TAG CMD=version
    deploy:
      provider: script
      script: make push TAG=$TRAVIS_TAG
    on:
      tags: true
      all_branches: true
  # --------------------------------------------

I’m new to travis-ci so it might just be a lack of experience :wink: … any help would be very welcome, thanks!

Example job (tag): https://travis-ci.com/alex-leonhardt/gocd-seeder/jobs/156234820
Example job (master): https://travis-ci.com/alex-leonhardt/gocd-seeder/jobs/156234815

Alex

Your deployment condition is outdented one level up, so the on condition is not effective. The deployment condition is set to default, meaning that only the master branch is permitted to trigger deployment. Pushing these lines one level down should achieve what you are after.

1 Like

Oh i see, ok, let me try that :slight_smile:

thanks @BanzaiMan - that worked! :slight_smile: :+1: