Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

more flexible docker#600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 2 commits intopython-gitlab:masterfromhans-d:docker
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletionscontrib/docker/Dockerfile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
FROM python:slim
FROM python:alpine

# Install python-gitlab
RUN pip install --upgrade python-gitlab

# Copy sample configuration file
COPY python-gitlab.cfg /
COPY entrypoint-python-gitlab.sh /usr/local/bin/.

# Define the entrypoint that enable a configuration file
ENTRYPOINT ["gitlab", "--config-file", "/python-gitlab.cfg"]
WORKDIR /src

ENTRYPOINT ["entrypoint-python-gitlab.sh"]
CMD ["--version"]
15 changes: 8 additions & 7 deletionscontrib/docker/README.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
python-gitlab docker image
==========================

Dockerfile contributed by *oupala*:
https://github.com/python-gitlab/python-gitlab/issues/295

How to build
------------

``docker build -tme/python-gitlab:VERSION .``
``docker build -t python-gitlab:VERSION .``

How to use
----------

``docker run -it -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...``
``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> =/python-gitlab.cfg python-gitlab <command> ...``

To change the endpoint, add `-e GITLAB_URL=<your url>`


Bring your own config file:
``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...``

To make things easier you can create a shell alias:

``alias gitlab='docker run --rm -it -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab``
21 changes: 21 additions & 0 deletionscontrib/docker/entrypoint-python-gitlab.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
#!/bin/sh

GITLAB_CFG=${GITLAB_CFG:-"/etc/python-gitlab-default.cfg"}

cat << EOF > /etc/python-gitlab-default.cfg
[global]
default = gitlab
ssl_verify = ${GITLAB_SSL_VERIFY:-true}
timeout = ${GITLAB_TIMEOUT:-5}
api_version = ${GITLAB_API_VERSION:-4}
per_page = ${GITLAB_PER_PAGE:-10}

[gitlab]
url = ${GITLAB_URL:-https://gitlab.com}
private_token = ${GITLAB_PRIVATE_TOKEN}
oauth_token = ${GITLAB_OAUTH_TOKEN}
http_username = ${GITLAB_HTTP_USERNAME}
http_password = ${GITLAB_HTTP_PASSWORD}
EOF

exec gitlab --config-file "${GITLAB_CFG}" $@
15 changes: 0 additions & 15 deletionscontrib/docker/python-gitlab.cfg
View file
Open in desktop

This file was deleted.


[8]ページ先頭

©2009-2025 Movatter.jp