Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtsi-hgi/docker-with-gitlab-secrets
Wraps Docker to run with GitLab build variables
https://github.com/wtsi-hgi/docker-with-gitlab-secrets
docker gitlab secrets
Last synced: 8 days ago
JSON representation
Wraps Docker to run with GitLab build variables
- Host: GitHub
- URL: https://github.com/wtsi-hgi/docker-with-gitlab-secrets
- Owner: wtsi-hgi
- License: mit
- Created: 2017-05-10T15:41:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-29T15:47:56.000Z (almost 6 years ago)
- Last Synced: 2024-10-09T04:28:42.826Z (30 days ago)
- Topics: docker, gitlab, secrets
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/wtsi-hgi/docker-with-gitlab-secrets.svg)](https://travis-ci.org/wtsi-hgi/docker-with-gitlab-secrets)
[![codecov.io](https://codecov.io/gh/wtsi-hgi/docker-with-gitlab-secrets/graph/badge.svg)](https://codecov.io/github/wtsi-hgi/docker-with-gitlab-secrets)
[![PyPI version](https://badge.fury.io/py/dockerwithgitlabsecrets.svg)](https://badge.fury.io/py/dockerwithgitlabsecrets)# Docker With GitLab Secrets
*Wraps Docker to run with GitLab build variables.*## Installation
Prerequisites:
- Python >= 3.6
- dockerStable releases can be installed via [PyPI](https://pypi.python.org/pypi/dockerwithgitlabsecrets):
```bash
$ pip install dockerwithgitlabsecrets
```Bleeding edge versions can be installed directly from GitHub:
```bash
$ pip 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:
```bash
usage: docker-with-gitlab-secrets [-h] [--dwgs-config DWGS_CONFIG]
[--dwgs-project DWGS_PROJECT]
[--env-file ENV_FILE]Docker With GitLab Secrets
optional arguments:
-h, --help show this help message and exit
--dwgs-config DWGS_CONFIG
location of the configuration file (will default to
~/.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:
```bash
docker-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:
```bash
docker-with-gitlab-secrets --dwgs-config my-config.yml \
version
```Run a container interactively that will have secrets from a GitLab project in the environment:
```bash
docker-with-gitlab-secrets --dwgs-config my-config.yml --dwgs-project my-project \
run --rm -it ubuntu
```## Configuration
Example:
```yml
gitlab:
url: https://gitlab.example.com
token: my-token
project: hgi-systems # Optional default project, which will be overriden if `dwgs-project` is specified
namespace: hgi # Optional default namespace, which will be overriden if defined in the project (e.g. `hgi/hgi-systems`)
```## Known Issues
- Docker [cannot pass newlines in variables via `--env-file`](https://github.com/moby/moby/issues/12997). Therefore
multiline GitLab variables with have their line-breaks escaped to \\n.