3

I want the build process to run for all branches when I add a tag. Except for the master branch.

deploy_qas:
  stage: deploy
  script:
   - echo "Implatado em QAS"
  environment:
    name: qas
    url: https://env.br
  only:
  - tags
  except:
  - master

This way it is not working.

I am using GitLab 13 ce.

Miltex
  • 302
  • 1
  • 13

1 Answers1

0

The new Gitlab syntax uses rules.

only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.

Solution with rules:

deploy_qas:
  stage: deploy
  script:
   - echo "Implatado em QAS"
  environment:
    name: qas
    url: https://env.br
  rules:
    - if: $CI_COMMIT_BRANCH == 'master'
      when: never
    - if: $CI_COMMIT_TAG  
      # `when: always` is implied here
Blaise
  • 13,139
  • 9
  • 69
  • 97