I want distribution a same project to multiple agent.
I create a drone server and two drone agent (agt0, agt1). when I push code to master branch want use agt0 agent to execute, dev branch use agt1 agent to execute.
My config is here
machine 1*
drone server && agent (agt0)
drone_server:
container_name: drone-server
image: drone/drone:1.6
restart: always
environment:
- DRONE_GITEA_CLIENT_ID=xxxxx
- DRONE_GITEA_CLIENT_SECRET=xxxxx
- DRONE_GITEA_SERVER=https://git.com
- DRONE_GIT_ALWAYS_AUTH=false
- DRONE_SERVER_HOST=drone.com
- DRONE_SERVER_PROTO=https
- DRONE_RPC_SECRET=xxxxx
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
drone_agent:
container_name: drone-agent
image: drone/agent:1.6
restart: always
environment:
- DRONE_RPC_PROTO=https
- DRONE_RPC_HOST=drone.com
- DRONE_RPC_SECRET=xxxxx
- DRONE_RUNNER_CAPACITY=3
- DRONE_RUNNER_NAME=agt0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "3000:3000"
machine 2*
drone agent (agt1)
drone_agent:
container_name: drone-agent
image: drone/agent:1.6
restart: always
environment:
- DRONE_RPC_PROTO=https
- DRONE_RPC_HOST=drone.com
- DRONE_RPC_SECRET=xxxxx
- DRONE_RUNNER_CAPACITY=3
- DRONE_RUNNER_NAME=agt1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "3000:3000"
.drone.yml
---
kind: pipeline
name: default
---
kind: pipeline
name: agt0
steps:
- name: echo
image: alpine:edge
commands:
- echo 'agt0 execute'
trigger:
instance:
- agt0
branch:
- master
event:
- push
---
kind: pipeline
name: agt1
steps:
- name: echo
image: alpine:edge
commands:
- echo 'agt1 execute'
trigger:
instance:
- agt1
branch:
- dev
event:
- push
Now when I push any branch always execute in agt0, and when I down agt0, this event can execute use agt1.
Not the expected way of execution