How to pass parameters in deploy mode. After I pass them, they cannot be seen in the environment variables. How do I receive them?
---
kind: pipeline
type: docker
name: default
steps:
- name: tpl-reaplace
image: repository.241210.com/repository/gyys/tpl:2
commands:
- TPL_PATH="./yaml/*.yaml" TPL_VALUESPATH="./yamlvalues/*.toml" TPL_OUTPATH="./yamlout/" TPL_COMMONPATH="./yamlvalues/common/" TPL_TAG="develop" tpl
- ls ./yamlout/
- env
- name: develop
image: repository.241210.com/repository/gyys/tpl:2
commands:
- env
- TPL_PATH="./yaml/*.yaml" TPL_VALUESPATH="./yamlvalues/*.toml" TPL_OUTPATH="./yamlout/" TPL_COMMONPATH="./yamlvalues/common/" TPL_TAG="${deploy}" tpl
- ls ./yamlout/
when:
target:
- develop
- test
- prod
environment:
- deploy
Hi,
If you need to customize Drone in order to pass additional environment variables to your pipeline, the recommended approach is to create an environment extension. See https://docs.drone.io/extensions/environment/
It sounds like an environment extension (described above) is the best approach if you need something more dynamic and custom, but you can also load global environment variable from a file by providing the runner with an environment file:
https://docs.drone.io/runner/docker/configuration/reference/drone-runner-env-file/