# \[resolved\] Global env vars not injecting

**URL:** <https://drone.discourse.group/t/resolved-global-env-vars-not-injecting/10677>\
**Category:** Drone Support\
**Created:** [May 4, 2020, 8:11am UTC](https://drone.discourse.group/t/resolved-global-env-vars-not-injecting/10677 "2020-05-04T08:11:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewmclagan](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/andrewmclagan/32/5283_2.png) [@andrewmclagan](https://drone.discourse.group/u/andrewmclagan)\
**Post date:** [May 4, 2020, 8:11am UTC](https://drone.discourse.group/t/resolved-global-env-vars-not-injecting/10677/1 "2020-05-04T08:11:29Z")

</div>

According to the latest docs its possible to configure `docker` pipelines to have global environment variables injected into each step. [docs](https://docs.drone.io/pipeline/environment/syntax/)

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

```auto
kind: pipeline
type: docker
name: default

environment:
  HELLO: "world"

steps:
  - name: "echo"
    image: alpine
    commands:
      - 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.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 4, 2020, 1:14pm UTC](https://drone.discourse.group/t/resolved-global-env-vars-not-injecting/10677/2 "2020-05-04T13:14:55Z")

</div>

We tested and it is working for us.

here is a copy of our yaml:

> <https://github.com/drone/hello-world/commit/3c8d0de2ed8b110d1f21610808ff3659bdc0b766>

here is the output:  
[https://cloud.drone.io/drone/hello-world/120/1/2](https://cloud.drone.io/drone/hello-world/120/1/2)

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.

---

<div class="post-metadata">

**Author:** ![andrewmclagan](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/andrewmclagan/32/5283_2.png) [@andrewmclagan](https://drone.discourse.group/u/andrewmclagan)\
**Post date:** [May 5, 2020, 11:49pm UTC](https://drone.discourse.group/t/resolved-global-env-vars-not-injecting/10677/3 "2020-05-05T23:49:02Z")

</div>

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
