Hello there, I’ve been trying out drone deployments in our QA environment. However, I’ve been seeing some weird behavior related to the branch conditions.
Here’s an example of what I’m using.
- name: docker-qa
image: plugins/docker
settings:
username:
from_secret: DOCKER_ORG_LOGIN
password:
from_secret: DOCKER_ORG_PASSWORD
repo: yourcompany/${DRONE_REPO_NAME}
registry: yourcompany
tags:
- ${DRONE_COMMIT_BRANCH/release\//}
- ${DRONE_COMMIT_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
dockerfile: ./Dockerfile
when:
branch:
- release/*
event:
- push
- name: deploy-kube-qa
image: honestbee/drone-kubernetes
settings:
kubernetes_server:
from_secret: KUBERNETES_SERVER_QA
kubernetes_cert:
from_secret: KUBERNETES_QA_CERT
kubernetes_token:
from_secret: KUBERNETES_QA_TOKEN
namespace: namespace
deployment: deploy
container: container
repo: yourcompany/${DRONE_REPO_NAME}
tags:
- ${DRONE_COMMIT_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
when:
branch:
- release/*
event:
- push
- name: deploy-kube-hotfix
image: honestbee/drone-kubernetes
settings:
kubernetes_server:
from_secret: KUBERNETES_SERVER_QA
kubernetes_cert:
from_secret: KUBERNETES_QA_CERT
kubernetes_token:
from_secret: KUBERNETES_QA_TOKEN
namespace: namespace
deployment: deploy
container: container
repo: yourcompany/${DRONE_REPO_NAME}
tags:
- ${DRONE_COMMIT_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
when:
branch:
- hotfix/*
event:
- push
So, whenever I push a commit to a feature branch, both deploy steps are getting triggered.
Any help will be appreciated.