Skip to main content

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

Project description

git-vars - Manage GitLab Environment Variables with Ease

git-vars is a Python package that simplifies managing GitLab environment variables. It allows you to seamlessly synchronize environment variables between your local machine and GitLab projects. This streamlines your development workflow by ensuring consistency and eliminating the hassle of manual updates.

Installation

Install git-vars using pip:

pip install  git-vars

Usage

git-vars offers three main subcommands: configure, pull, and push.

Pull

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

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

Options:

-s, --scope: (Optional) The scope of environment variables to pull. Valid options are project, group, or instance. If not provided, the scope from the .git-vars file will be used (defaults to project if not set in .git-vars).

-f, --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-vars push  -t <access_token> -r <repository_url> [options]

Options:

-s, --scope: (Optional) The scope of environment variables to pull. Valid options are project, group, or instance. If not provided, the scope from the .git-vars file will be used (defaults to project if not set in .git-vars).

-f, --file: Path to the file containing environment variables to push. Defaults to .env.

Configure

Use the configure command to create or update the .git-vars file with your GitLab access token and repository URL.

git-vars configure -t <access_token> -r <repository_url>

-t, --access-token: Your GitLab personal access token. This will be saved in the .git-vars file.

-r, --repository-url: The URL of your GitLab repository. This will be saved in the .git-vars file.

-s, --scope: The scope of environment variables to pull. Valid options are project (default), group, or instance. If not provided, defaults to project.

Example:

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

git-vars pull -f my_env.txt

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

git-vars push -s group -f 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 -f or --file).

For detailed information on specific functionalities and error handling, refer to the source code within the package.

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_vars-0.0.6.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

git_vars-0.0.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file git_vars-0.0.6.tar.gz.

File metadata

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

File hashes

Hashes for git_vars-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c897eda3e1c7c46ddba12aaa37dcb648b13a5f8eb7b0605d3491d1ff1901c80e
MD5 7765a2718dff62a40860bdb6464b164e
BLAKE2b-256 29ee59bcb2dc309663e0a768138f2ee3fbf0b61af446816df8f983ace7033a9a

See more details on using hashes here.

File details

Details for the file git_vars-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: git_vars-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for git_vars-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 46affb8d29e627f9fea4d36c24c6928784bcf9a7c0ce707bbf7038fe6a40eb75
MD5 a1a1c9ac4a5f937c711b882410c4ee6a
BLAKE2b-256 e489ba37105d123add94d18ea011c33bf233a3877b29f80c40bb38989e1cab2c

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