Skip to main content

A Python wrapper for retrieving Gitlab CI/CD variables

Project description

Glabvars

A Python wrapper for retrieving Gitlab Ci/CD variables to enable injecting them into locally running GitLab CI/CD pipelines run with gitlab-ci-local.

Features:

Usage

Run the glabvars CLI app inside a git repository with a Gitlab remote. The application can return a YAML configuration string for gitlab-ci-local to stdout. You can pipe this output to .gitlab-ci-local-variables.yml so that gitlab-ci-local can use the variables.

glabvars --target gcl > .gitlab-ci-local-variables.yml

Output targets

Gitlab-CI-Local: gcl

When passing --target gcl, glabvars will output to stdout a YAML configuration file that can be used by gitlab-ci-local.

Environment: env

When passing --target env, glabvars will output .env files and file-type variable files. These files are postfixed with .<environment_scope> if the environment_scope of a CI/CD variable is not '*'. These files are written in the --env-path directory (default: .gitlab)

Installation

Install with pip to install globally:

pip install glabvars

Or alternatively with pipx to isolate dependencies of glabvars from other globally installed Python apps (requires pipx):

pipx install glabvars

Requirements

You must have glab installed and be authenticated with the relevant Gitlab instance to retrieve the CI/CD variables. Check whether you are authenticated by calling glab auth status.

Future work

Make it extensible to other targets.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glabvars-0.2.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glabvars-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file glabvars-0.2.0.tar.gz.

File metadata

  • Download URL: glabvars-0.2.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.6.1 CPython/3.8.16

File hashes

Hashes for glabvars-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f558aeb8ff10822d71a59fa8a2ea64a989cba580e1aadfa67b89e7bffd810c5f
MD5 3e90e03e1ac96ab631dbb19818c35000
BLAKE2b-256 85ab957e025cca0864197caf334cc29d77ea6cf3e345603df8abb76e7b20a920

See more details on using hashes here.

File details

Details for the file glabvars-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: glabvars-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.6.1 CPython/3.8.16

File hashes

Hashes for glabvars-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 899fc63c54f7d31277c731f85cbbcff1e4ddeb693569013115e494c17bbedbcd
MD5 c3f40cb2071c329abdd88d7e5447a237
BLAKE2b-256 4fb3e008c3087e48f05ff1b45b0e176fc33af2ba28244f352a2f4736cade6894

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page