-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathprovision-gitlab-cli.sh
More file actions
32 lines (27 loc) · 929 Bytes
/
provision-gitlab-cli.sh
File metadata and controls
32 lines (27 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -eux
# create venv.
apt-get install -y python3-pip python3-venv
python3 -m venv --system-site-packages ~/.venv
# configure the shell to find the venv binaries.
echo 'export PATH="$HOME/.venv/bin:$PATH"' >>~/.bash_login
export PATH="$HOME/.venv/bin:$PATH"
# install.
# see https://pypi.org/project/python-gitlab/
# renovate: datasource=pypi depName=python-gitlab
python_gitlab_version='8.1.0'
python3 -m pip install "python-gitlab==$python_gitlab_version"
# NB on Windows, to trust the certificates in the Windows CA trust store
# you also need to pip3 install python-certifi-win32.
# configure gitlab-cli with the root token.
cat >~/.python-gitlab.cfg <<EOF
[global]
default = gitlab.example.com
ssl_verify = true
timeout = 5
[gitlab.example.com]
url = https://gitlab.example.com
private_token = $(cat /vagrant/tmp/gitlab-root-personal-access-token.txt)
api_version = 4
EOF
chmod 600 ~/.python-gitlab.cfg