This feature is only available in the Enterprise expansion pack
The enterprise expansion pack provides support for global environment variables, sourced from a yaml file on your server. You should mount the environment file into your container and specify the path to the file in your configuration.
Example server configuration:
services:
drone-server:
image: drone/drone:0.8
ports:
- 80:8000
volumes:
- /var/lib/drone:/var/lib/drone/
+ - /etc/drone-env.yml:/etc/drone-env.yml
restart: always
environment:
+ DRONE_GLOBAL_ENVIRON=/etc/drone-env.yml
Example environment file:
- name: GITHUB_USERNAME
value: octocat
- name: GITHUB_PASSWORD
value: correct-horse-batter-staple
Restricting Access
You can restrict access to global environment variables based on repository name using the repos
attribute. This is defined as an array list with glob support.
- name: GITHUB_USERNAME
value: octocat
repos: [ octocat/hello-world, github/* ]
- name: GITHUB_PASSWORD
value: correct-horse-batter-staple
repos: [ octocat/hello-world, github/* ]
Is there a mistake on this page? Please let us know or edit this page.