SDK tool to connect Gitlab pipelines with Workflows
Project description
Gitoptim SDK
Introduction
Gitoptim SDK is a CLI tool that enables integration of Gitlab pipelines and Workflows. It is designed to be used in CI/CD jobs.
Features
-
Gitlab CI/CD logs analysis
-
Memlab integration
Development
Prerequisites
- Python 3.11 or later
- Poetry for dependency management
Setup
- Install dependencies using
poetry install --with dev
- Install git hooks using
pre-commit install
. This will run linters and formatters before each push to repository.
Environment variables
The following environment variables are required in order to run the CLI:
CI_PROJECT_ID
CI_JOB_ID
CI_API_V4_URL
GITOPTIM_PRIVATE_TOKEN - Gitlab personal or project access token with `api-read` scope and `Guest` role
Variables prefixed with CI_
are provided by Gitlab CI/CD.
See: docs
Pycharm
- Set the Python interpreter to the one created by Poetry. This can be done by going
to
File -> Settings -> Project-> Python Interpreter
and selecting the interpreter created by Poetry. Path to the interpreter can be found by runningpoetry env info
in the terminal. - Install Pylint plugin for Pycharm.
- Enable "Reformat code" on save. This can be done by going to
File -> Settings -> Tools -> Actions On Save
.
How to run
- Run
poetry shell
to activate the virtual environment. - Run
python -m gitoptim
to start the CLI.
Important: In order to push to repository you need to have poetry shell enabled so that git hooks can run.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gitoptim-0.1.0.dev19.tar.gz
(8.2 kB
view hashes)
Built Distribution
Close
Hashes for gitoptim-0.1.0.dev19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a76248e6b0abf44b49f91aeed890713b6dc91dacb0ded7e7e05551eabf62f5f |
|
MD5 | 001c0c66fb48195f4f1e426c46db178c |
|
BLAKE2b-256 | 87240bf24bc31ba999a4f3a49cd6c49668190df8f8e90c5bce123aa83bfca925 |