Hey there!
[Drone 1.2.1]
I’ve been searching around on how to pass variables to a pipeline that uses the plugins/docker.
In fact, I would like to set the registry setting from a variable that could be reused in other pipelines.
Is there a way to do so in the .drone.yml
file ?
Here is what a tried but the settings does not take the variables… no luck to make it work.
See the below repo or registry settings that I try to inflate with variables.
variables:
environment: &default_environment
REGISTRY: registry.mydomain.com
DOMAIN: mydomain.com
kind: pipeline
name: default
steps:
- name: build:master
image: plugins/docker
environment:
<<: *default_environment
settings:
repo: registry.${DOMAIN}/${DRONE_REPO,,}
tags:
- ${DRONE_SOURCE_BRANCH/\//-}
- ${DRONE_SOURCE_BRANCH/\//-}-${DRONE_COMMIT_SHA:0:8}
registry: ${REGISTRY}
username:
from_secret: REGISTRY_USERNAME
password:
from_secret: REGISTRY_PASSWORD
when:
branch:
- master
event:
exclude:
- tag
Thanks in advance for any advice or help!
Antoine