dockerwithgitlabsecrets-2.0.1
توضیحات
Wraps Docker to run with GitLab build variables
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dockerwithgitlabsecrets-2.0.1 |
| نام | dockerwithgitlabsecrets |
| نسخه کتابخانه | 2.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Colin Nolan |
| ایمیل نویسنده | colin.nolan@sanger.ac.uk |
| آدرس صفحه اصلی | https://github.com/wtsi-hgi/docker-with-gitlab-secrets |
| آدرس اینترنتی | https://pypi.org/project/dockerwithgitlabsecrets/ |
| مجوز | MIT |
|Build Status| |codecov.io| |PyPI version|
Docker With GitLab Secrets
==========================
*Wraps Docker to run with GitLab build variables.*
Installation
------------
Prerequisites: - Python >= 3.6 - docker
Stable releases can be installed via
`PyPI <https://pypi.python.org/pypi/dockerwithgitlabsecrets>`__:
.. code:: bash
$ pip install dockerwithgitlabsecrets
Bleeding edge versions can be installed directly from GitHub:
.. code:: 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:
.. code:: 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
/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:
.. code:: 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:
.. code:: 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:
.. code:: bash
docker-with-gitlab-secrets --dwgs-config my-config.yml --dwgs-project my-project \
run --rm -it ubuntu
Configuration
-------------
Example:
.. code:: yml
gitlab:
url: https://gitlab.example.com
token: my-token
project: hgi-systems # Optional default project, which will be overriden by if `dwgs-project` is specified
namespace: hgi # Optional default namespace
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.
.. |Build Status| image:: https://travis-ci.org/wtsi-hgi/docker-with-gitlab-secrets.svg
:target: https://travis-ci.org/wtsi-hgi/docker-with-gitlab-secrets
.. |codecov.io| image:: https://codecov.io/gh/wtsi-hgi/docker-with-gitlab-secrets/graph/badge.svg
:target: https://codecov.io/github/wtsi-hgi/docker-with-gitlab-secrets
.. |PyPI version| image:: https://badge.fury.io/py/dockerwithgitlabsecrets.svg
:target: https://badge.fury.io/py/dockerwithgitlabsecrets
نحوه نصب
نصب پکیج whl dockerwithgitlabsecrets-2.0.1:
pip install dockerwithgitlabsecrets-2.0.1.whl
نصب پکیج tar.gz dockerwithgitlabsecrets-2.0.1:
pip install dockerwithgitlabsecrets-2.0.1.tar.gz