wtsi-hgi/docker-with-gitlab-secrets

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

Homepage:

Size: 36

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status codecov.io PyPI version

Docker With GitLab Secrets

Wraps Docker to run with GitLab build variables.

Installation

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
Usage

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
Examples

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
Configuration

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`)
Known Issues

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.