Posts Tagged: gitlab

Gitlab API and Python

To start, create a config file with your Gitlab personal token: vi ~/.python-gitlab.cfg With contents similar to below: [global] default = gitlab ssl_verify = true timeout = 5 [gitlab] url = https://gitlab.com private_token = 1234ABCD1234ABCD api_version = 4 next create a directory and a python virtualenv: bashmkdir ./code/python/testpython3 -m venv envsource env/bin/activatepip3 install requests python-gitlab… Read more »

Gitlab Bulk Update can_create_group

I had been allowing normal users to create groups within Gitlab but subsequently discovered some confusion among users between groups and projects. Some users had been creating a group with a single project when a project with multiple members was more suitable. A decided to update the Gitlab CE database to amend the users table… Read more »

Gitlab API Command Line Access

There appears to be a few methods for managing a Gitlab installation from the command line. I liked python-gitlab and I installed it onto Linux Mint/Ubuntu as follows: apt-get install python-pip pip install python-gitlab After installation I created a config file: ~/.python-gitlab.cfg With the content as below but the private_token would need changed for your… Read more »

Deploying a Web Project from Gitlab

gitlab deploy hooks

I wanted to automatically deploy a web project when any updates are pushed to the gitlab repository. To do so I added a ‘Web Hook’. The Web Hook calls a URL in response to ‘push’ events. I created a PHP page to be called by the Web Hook: So in response to push events gitlab_hook.php… Read more »

Browsing the GitLab Omnibus Postgres Database

phpPgAdmin

After installing GitLab Omnibus edition I wanted to take a look at the database tables. To do so I installed phpPgAdmin (available in the EPEL repo): yum install phpPgAdmin I created a user in Postgres for use with phpPgAdmin: su – gitlab-psql /opt/gitlab/embedded/bin/psql gitlabhq_production gitlabhq_production=# CREATE USER jonny_test WITH PASSWORD ‘opensesame’; CREATE ROLE gitlabhq_production=# GRANT… Read more »

Gitlab Omnibus – Change the Nginx Port

Ignore original text below. The correct method is to amend the /etc/gitlab/gitlab.rb file with the port e.g.: external_url “https://gitlab.domain.co.uk:8443” nginx[‘ssl_certificate’] = “/etc/pki/tls/certs/pubkey.pem” nginx[‘ssl_certificate_key’] = “/etc/pki/tls/private/privkey.pem” Then run: gitlab-ctl reconfigure   Doing a ps -ef | grep nginx allowed me to track down the configuration file: /var/opt/gitlab/nginx/etc/gitlab-http.conf That file specified the port number (see below) and… Read more »