Skip to main content

Python packages that allows to manage GitLab env variables seamlessly between remote and local respository

Project description

git-variables - Manage GitLab Environment Variables

git-variables is a Python package designed to simplify the management of GitLab environment variables. It allows you to easily pull environment variables from your GitLab project to your local machine or push local environment variables to your GitLab project. This streamlines your development workflow by ensuring consistency between local and GitLab environments.

Installation

Install git-variables using pip:

pip install git-variables

Usage

git-variables offers two main subcommands: pull and push.

Pull

Use the pull command to retrieve environment variables from your GitLab project and store them in a local file.

git-variables pull -t <access_token> -r <repository_url> [options]

Options:

-t, --access-token: Your GitLab personal access token with sufficient permissions to access environment variables. -r, --repository-url: The URL of your GitLab repository. -s, --scope: (Optional) The scope of environment variables to pull. Valid options are project (default), group, or instance. -o, --output-file: (Optional) Path to the file where downloaded variables will be saved. Defaults to .env.

Push

Use the push command to update GitLab environment variables from a local file.

git-variables push -t <access_token> -r <repository_url> [options]

Options:

-t, --access-token: Your GitLab personal access token with sufficient permissions to manage environment variables. -r, --repository-url: The URL of your GitLab repository. -s, --scope: (Optional) The scope of environment variables to push. Valid options are project (default), group, or instance. -e, --env-vars: Path to the file containing environment variables to push. Defaults to .env.

Example:

Pull project environment variables from your GitLab repository and save them to a file named my_env.txt:

git-variables pull -t your_access_token -r https://gitlab.com/username/project-name -o .env

Push environment variables defined in local_env.env to your GitLab project's group environment variables:

git-variables push -t your_access_token -r https://gitlab.com/username/group-name -s group -e local_env.env

Additional Notes

Make sure you have a personal access token with the necessary permissions created in your GitLab account. Environment variables are stored in a standard .env file format on your local machine (configurable with -o or --output-file). For detailed information on specific functionalities and error handling, refer to the source code within the package.

Contributing

We welcome contributions to improve this project. Please refer to the Contributing Guide (if available) for details on how to submit pull requests and participate in development.

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

git_variables-0.1.6.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

git_variables-0.1.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file git_variables-0.1.6.tar.gz.

File metadata

  • Download URL: git_variables-0.1.6.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for git_variables-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e1140b5b9d17c89371d5b53da8acb99aa2a951f087335cd1a91da0cf32ac0123
MD5 dd17fefad955a641ef69d8d184fea79a
BLAKE2b-256 2b5dced924dd486d60418f40f8189c0204821cf3a36c20d0cf090d410074ee56

See more details on using hashes here.

File details

Details for the file git_variables-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for git_variables-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c8186911314d8ea92990abcc2df4b44acc517953867b7c723f83850e1baabe00
MD5 5ce68bee32baee0b3cb22d7c28d9c51c
BLAKE2b-256 628b1b3660c2763c3280129984afd80501cd8e190bc8c9df6f6a117c4698dcf3

See more details on using hashes here.

Supported by

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