Giter Club home page Giter Club logo

gitlab-vars's Introduction

License: MIT Go Report Card Tests Codecov Release

glvars

Description

glvars CLI tool for import and export project-level Gitlab CI/CD Variables.

Setup

  • Using environment variables add your personal access token (api scope) and project id (optional):
 export GLVARS_PRIVATE_TOKEN="your-personal-access-token"
 export GLVARS_PROJECT_ID=278964 # Your gitlab project id
  • Or you can create config file .glvars.yaml (in $HOME directory):
  host: gitlab.example.com # For gitlab server on own domain. By default: https://gitlab.com
  private-token: your-gitlab-private-token
  project-id: 278964
  • You also can specify your project id using flag -p or --project:
  glvars [command] -p 278964

Use cases and examples

  • Export variables in JSON format from project specified in config file or env variable:
  glvars export

or you can explicitly specify project id using flag -p:

  glvars export -p 278964
  • To import variables into a project use command import with -f or --filename flag with value path to file with array of variables
  glvars import -f ./vars.json

JSON file example:

[
  {
    "variable_type": "env_var",
    "key": "MYSQL_HOST",
    "value": "127.0.0.1",
    "protected": false,
    "masked": false,
    "raw": true,
    "environment_scope": "production"
  },
  {
    "variable_type": "env_var",
    "key": "MYSQL_USER",
    "value": "admin",
    "protected": false,
    "masked": false,
    "raw": true,
    "environment_scope": "production"
  }
]

Installation

Download a binary suitable for your OS at the release page.

You can build project from source:

  go build -o glvars cmd/main.go

gitlab-vars's People

Contributors

erminson avatar lodinis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.