Name: docker-with-gitlab-secrets
Owner: Wellcome Trust Sanger Institute - Human Genetics Informatics
Description: Wraps Docker to run with GitLab build variables
Created: 2017-05-10 15:41:50.0
Updated: 2017-05-15 10:31:10.0
Pushed: 2017-06-20 22:59:53.0
Size: 36
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Wraps Docker to run with GitLab build variables.
Prerequisites:
Stable releases can be installed via PyPI:
p install dockerwithgitlabsecrets
Bleeding edge versions can be installed directly from GitHub:
p install git+https://github.com/wtsi-hgi/docker-with-gitlab-secrets.git@commit_id_or_branch_or_tag#egg=dockerwithgitlabsecrets
Wrap your prefixed Docker command with:
e: docker-with-gitlab-secrets [-h] [--dwgs-config DWGS_CONFIG]
[--dwgs-project DWGS_PROJECT]
[--env-file ENV_FILE]
er With GitLab Secrets
onal arguments:
, --help show this help message and exit
dwgs-config DWGS_CONFIG
location of the configuration file (will default to
/Users/cn13/.dwgs-config.yml)
dwgs-project DWGS_PROJECT
GitLab project (if not namespaced in the form
"namespace/project", the default namespace defined in
the configuration file will be used). If not defined,
the default project in the configuration file will be
used
Run a new container with secrets from a GitLab project:
er-with-gitlab-secrets --dwgs-config my-config.yml --dwgs-project my-project \
run --rm alpine printenv GITLAB_SECRET
Wrapping unrelated Docker commands will still work:
er-with-gitlab-secrets --dwgs-config my-config.yml \
version
Run a container interactively that will have secrets from a GitLab project in the environment:
er-with-gitlab-secrets --dwgs-config my-config.yml --dwgs-project my-project \
run --rm -it ubuntu
Example:
ab:
l: https://gitlab.example.com
ken: my-token
oject: hgi-systems # Optional default project, which will be overriden if `dwgs-project` is specified
mespace: hgi # Optional default namespace, which will be overriden if defined in the project (e.g. `hgi/hgi-systems`)
--env-file
. Therefore
multiline GitLab variables with have their line-breaks escaped to \n.