[resolved] Global env vars not injecting

According to the latest docs its possible to configure docker pipelines to have global environment variables injected into each step. docs

A simple test on our drone server (latest 1.7) shows steps do not recieve the variables:

kind: pipeline
type: docker
name: default

  HELLO: "world"

  - name: "echo"
    image: alpine
      - echo ${HELLO}
      - echo $${HELLO}
      - echo $HELLO
      - echo $$HELLO
      - env

The HELLO env var is not echoing with its value as its not being injected as per docs. Pipeline is docker.

If this would have any influence: we are running “docker” pipelines although the actual agents/server are running inside K8s, we create very simple k8s yaml configs for the setup. Basically its docker inside k8s everything else works perfectly aside from this.

We tested and it is working for us.

here is a copy of our yaml:

here is the output:

note that you mentioned you are running version 1.7 of the server, however the global environment variables are injected by the runner, so the runner version number is what actually matters here. You should therefore make sure you are using drone/drone-runner-docker:1.2 or higher.

Hey Brad, thank you for heads up. Its been a while since we updated our drone server. We were still running drone/agent:1 rather than the new runner image. Fixed the issue…! Interesting that it still built pipelines?! I guess has the same API