A Python script informing you about GitLab builds progress with native system notifications
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
resources
.env.example
.gitignore
LICENSE.md
README.md
requirements.txt
run.py

README.md

GitLab Notifier

A Python script informing you about GitLab builds progress with native system notifications.

Prerequisites

Python 3. May eventually works with Python 2 (not tested).

Installation

Clone this repo, and then the usual pip install -r requirements.txt.

Configuration

Copy the .env.example file to .env and fill in the configuration parameters.

Available configuration parameters are:

  • GITLAB_ENDPOINT Root URL to your GitLab instance
  • GITLAB_TOKEN Token used to access your GitLab instance API. You can create one in Profile Settings > Personal Access Tokens
  • POLL_INTERVAL Interval, in seconds, when the script will check for updates
  • FILTER_USERNAME A GitLab username to filter builds by (you probably don't want to be spammed by your coworkers builds) (optional)
  • FILTER_STAGE Only filter builds in this stage name (optional)

Usage

python run.py --project=4

--project is a GitLab project ID.

Best usage is to run it as a daemon or service (you probably don't want an ever-running terminal window).

How it works

This script, once started, polls the GitLab builds API of a specific project every 60 seconds (by default) indefinitely. It internally maintain a list of every builds that are in progress, thus allowing us to display native notifications when build statuses are updated.