Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
/ glenv Public archive

With direnv it will automatically export env. variables directly from GitLab

License

Notifications You must be signed in to change notification settings

kiwicom/glenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disclaimer

⚠️ This repository is no longer maintained, please use the fork at sn3d/glenv

glenv

version

Jump into your favourite repository folder and GitLab env. variables are automatically loaded into your shell. This tool in combination with direnv will export you project's env. variables from GitLab.

How it works

First, I have to say the glenv requires direnv installed.

Let's imagine we have clonned the hello/project repository into some folder.

$ clone git [email protected]:glenv-demo/hello/demo.git

Let's jump into cloned demo folder.

$ cd ~/demo
direnv: loading ~/demo/.envrc
direnv: export +CI_PROJECT_ID +DEMO_ENV ...

The direnv automatically inject all env. variables from GitLab into my shell.

When I jump-out from this folder:

$ cd ..
direnv: unloading

The direnv automatically unload all GitLab env. variables.

How to install

You can use Homebrew

brew install kiwicom/tap/glenv

Or you can download archive with binary here in GitHub releases. Installation is simple anyway. Download the desired archive for your system, unpack it and place it in some folder, which is in your PATH.

No need to configure. Only GITLAB_TOKEN variable need to be present in your environment.

How to enable it in repository

If you don't have .envrc in your repository directory, call the command:

$ glenv init

The command create .envrc file for you. Now you can allow the directory

$ direnv allow .

enjoy :-)