Code Monkey home page Code Monkey logo

gitlab-rescue's Introduction

GitHub tag (latest SemVer) GitHub Workflow Status (branch) license Coverage Status GitHub last commit (branch)

gitlab-rescue

CLI tool for getting and importing GitLab CI/CD variables from a project (Read only).

Installation

Check out the Release page for prebuilt versions of gitlab-rescue for many different architectures. For statically-linked binaries look for musl files.

Usage

Available commands

gitlab-rescue 0.1.0
CLI tool for getting and importing GitLab CI/CD variables from a project (Read only)

USAGE:
    gitlab-rescue [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    dotenv    Export project variables in the current shell (by default first 20 variables)
    get       Print variable in STDOUT
    help      Prints this message or the help of the given subcommand(s)

gitlab-rescue get

gitlab-rescue-get 0.1.0
Pedro Miranda <[email protected]>
Print variable in STDOUT

USAGE:
    gitlab-rescue get [FLAGS] [OPTIONS] <VARIABLE_NAME> --group <GITLAB_GROUP> --project <GITLAB_PROJECT>

FLAGS:
        --from-all-if-missing
            If variable(s) is(are) not found in defined environment (-e option), try searching in "All" environment.

    -h, --help
            Prints help information

    -V, --version
            Prints version information

OPTIONS:
    -e, --environment <ENVIRONMENT>
            Name of GitLab CI/CD environment. [default: All]

    -g, --group <GITLAB_GROUP>
            The ID of a group or URL-encoded path of the group. This should not be used with --project option.

    -p, --project <GITLAB_PROJECT>
            The ID of a project or URL-encoded NAMESPACE/PROJECT_NAME of the project. This should not be used with
            --group option.
    -t, --token <GITLAB_API_TOKEN>
            A valid GitLab API token. Alternatively, you can export GITLAB_API_TOKEN variable.

    -u, --url <GITLAB_URL>
            URL of GitLab API. [default: https://gitlab.com]. Alternatively, you can export GITLAB_URL variable.

ARGS:
    <VARIABLE_NAME>
            Name of GitLab CI/CD variable.

gitlab-rescue dotenv

gitlab-rescue-dotenv 0.1.0
Export project variables in the current shell (by default first 20 variables)

USAGE:
    gitlab-rescue dotenv [OPTIONS] <GITLAB_PROJECT>

FLAGS:
    -h, --help
            Prints help information

    -V, --version
            Prints version information

OPTIONS:
    -e, --environment <ENVIRONMENT>
            Name of GitLab CI/CD environment. [default: All]

        --folder <PATH>
            Path where variables with type "File" will be stored. Files will be created with format <VARIABLE_NAME>.var.
            [default: $PWD/.env.<ENVIRONMENT>]
    -o, --output <OUTPUT_FILE>
            Write dotenv to a file instead of stdout.

        --parallel <PARALLEL>
            Number of threads for GitLab API requests.

        --per-page <PER_PAGE>
            Number of items to bring per request.
            (See https://docs.gitlab.com/ee/api/README.html#offset-based-pagination). [default: 100]
    -s, --shell <SHELL>
            Generate dotenv for this shell type. Supported shells are: bash, zsh and fish. [default: bash]  [possible
            values: bash, zsh, fish]
    -t, --token <GITLAB_API_TOKEN>
            A valid GitLab API token. Alternatively, you can export GITLAB_API_TOKEN variable.

    -u, --url <GITLAB_URL>
            URL of GitLab API. [default: https://gitlab.com]. Alternatively, you can export GITLAB_URL variable.

ARGS:
    <GITLAB_PROJECT>
            The ID of a project or URL-encoded NAMESPACE/PROJECT_NAME of the project.

Examples

Get a variable

$ gitlab-rescue get MY_VARIABLE -p my-project
[INFO] Getting variable from project my-project...
[SUCCESS] Variable MY_VARIABLE obtained successfully
my-value

# Or export variable
$ export VARIABLE=$(gitlab-rescue get MY_VARIABLE -p my-project)
[INFO] Getting variable from project my-project...
[SUCCESS] Variable MY_VARIABLE obtained successfully
$ echo $VARIABLE
my-value

Creating a dotenv file

$ gitlab-rescue dotenv my-project -o .env
[INFO] Getting variables from project my-project...
[INFO] Creating files for variables of type File...
[INFO] Creating dotenv command list...
[INFO] File .env created successfully
$ cat .env
export MY_VARIABLE_1="a-value"
export MY_VARIABLE_2="another-value"
export MY_FILE_VARIABLE=".env.All/MY_FILE_VARIABLE.var"
$ ls .env.All
MY_FILE_VARIABLE.var

gitlab-rescue's People

Contributors

pedromctech avatar

Watchers

 avatar

gitlab-rescue's Issues

Some fixes

  • Fix ubuntu version in musl.
  • Fix cache key for musl
  • Fix binaries names
  • Fix badge in README

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.