I have set the DRONE_AGENT_ENV_FILE properly because when I do a docker inspect on the agent container, I see that my environment variables are set.
However, when I trigger a job and docker inspect the container running an individual step, I notice that the custom environment variables that are set in the agent container are not set in the step’s container.
This is problematic as the individual step needs to have PIP_INDEX_URL set, otherwise pip cannot find my private packages.
sorry, it was unclear this was in reference to the autoscaler. The autoscaler and runners both have a parameter call DRONE_AGENT_ENV_FILE, but they are unrelated. When passed to the autoscaler, this field sets agent environment variables. These variables do not propagate to the pipeline steps.
Sorry, the confusion here is because my initial answer assumed we were talking about runner (agent) configuration parameters, not autoscaler configuration parameters.
The autoscaler has a parameter named DRONE_AGENT_ENV_FILE which is used to source environment variables from a file. The variables are used to configure the runner (agent). They are not exposed to pipeline steps. Pipeline steps do not inherit runner environment variables because they contain sensitive information (rpc secrets, global secrets, global registry credentials, etc)
The docker runner (agent) does not have this configuration parameter.
Hopefully this helps clarify.
given the complexity of the autoscaler configuration, I no longer believe environment variables are the best way to configure the autoscaler. All of the names and naming conflicts have gotten very confusing. In version 2.0 of the autoscaler I plan to switch to a configuration file (toml, yaml, hcl, etc) which should make configuration more expressive and easier to understand.
I still plan to support configuration from environment variables, but only for a subset of commonly used configuration parameters. Anything more advanced would need to use a configuration file.