All Projects β†’ temando β†’ gitlab-ci-variables-cli

temando / gitlab-ci-variables-cli

Licence: MIT license
CLI tool to allow setting bulk project variables on Gitlab CI

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gitlab-ci-variables-cli

Semantic Release
πŸ“¦πŸš€ semantic-release written in go
Stars: ✭ 113 (+197.37%)
Mutual labels:  gitlab, gitlab-ci
GitLabCLI
Cross platform GitLab CLI tool
Stars: ✭ 28 (-26.32%)
Mutual labels:  gitlab, gitlab-ci
Python Gitlab
Python wrapper for the GitLab API
Stars: ✭ 1,679 (+4318.42%)
Mutual labels:  gitlab, gitlab-ci
Crane
⬆ A GitLab CI ready image to upgrade services in Rancher
Stars: ✭ 90 (+136.84%)
Mutual labels:  gitlab, gitlab-ci
Godot Ci
Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
Stars: ✭ 168 (+342.11%)
Mutual labels:  gitlab, gitlab-ci
Lab
lab is a cli client of gitlab like hub
Stars: ✭ 94 (+147.37%)
Mutual labels:  gitlab, gitlab-ci
gitlab-release-note-generator
A Gitlab release note generator
Stars: ✭ 88 (+131.58%)
Mutual labels:  gitlab, gitlab-ci
Lab
Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
Stars: ✭ 911 (+2297.37%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Ci Monitor
A simple dashboard for monitoring GitLab CI builds. Alpha version.
Stars: ✭ 152 (+300%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Ci Stack
Full CI pipeline project based on Gitlab & Gitlab CI running Docker, completely automated setup by Vagrant & Ansible, providing LetΒ΄s Encrypt certificates for private Servers, multiple Gitlab-Runners and the Gitlab Container Registry, incl. GitLab Pages
Stars: ✭ 146 (+284.21%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Ci Dashboard
πŸ“Š Dashboard for monitoring GitLab CI builds and pipelines for TV
Stars: ✭ 79 (+107.89%)
Mutual labels:  gitlab, gitlab-ci
podman-gitlab-runner
Use Podman as a custom executor for your Gitlab CI
Stars: ✭ 87 (+128.95%)
Mutual labels:  gitlab, gitlab-ci
Kira
🐿 Project management framework with deep philosophy underneath
Stars: ✭ 61 (+60.53%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Dashboard
πŸ“Ί TV dashboard for a global view on Gitlab Pipelines
Stars: ✭ 107 (+181.58%)
Mutual labels:  gitlab, gitlab-ci
Kdtool
Kubernetes deployment utility
Stars: ✭ 47 (+23.68%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Ci Local
Tired of pushing to test your .gitlab-ci.yml?
Stars: ✭ 134 (+252.63%)
Mutual labels:  gitlab, gitlab-ci
Gitlab Ci Pipeline Php
β˜•οΈ Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
Stars: ✭ 451 (+1086.84%)
Mutual labels:  gitlab, gitlab-ci
Glci
🦊 Test your Gitlab CI Pipelines changes locally using Docker.
Stars: ✭ 471 (+1139.47%)
Mutual labels:  gitlab, gitlab-ci
Gitlabapiclient
GitLab API client
Stars: ✭ 138 (+263.16%)
Mutual labels:  gitlab, gitlab-ci
gitlab-runner
Gitlab Runner on Alpine Linux [Docker]
Stars: ✭ 17 (-55.26%)
Mutual labels:  gitlab, gitlab-ci

Gitlab CI Variables Setter CLI

NPM Travis CI MIT License

CLI tool to allow setting/getting pipeline variables on Gitlab CI.

Supports Gitlab API v4, available since Gitlab 9.0.

Installation

Install the tool globally for ease of use, by running the following command

$ npm install -g gitlab-ci-variables-cli

Usage

Set one variable (glci set)

Run the following command, where:

  • gitlab-token is your Gitlab personal access token
  • gitlab-project-url is your project url on gitlab, e.g. https://gitlab.com/gitlab-org/gitlab-ce
  • key is the variable you want to set
  • value is the value of the variable you want to set
$ glci set --token <gitlab-token> --url <gitlab-project-url> --key <key> --value <value>
Set <key> = <value> for gitlab-org/gitlab-ce.
Completed setting variable on Gitlab CI.

Set several variables (glci setAll)

Put all required variable key/values on a properties file named gitlab.env.yml, e.g:

AWS_CREDENTIALS: |
    [canary]
    aws_access_key_id = AKIA1234
    aws_secret_access_key = verySecretKey
NPM_INSTALL_TOKEN: 123456789

Note that the value for AWS_CREDENTIALS is a multi line string (with spaces and no tabs).

Run the following command from the directory that contains the properties file.

$ glci setAll --token <gitlab-token> --url <gitlab-project-url>
Set AWS_CREDENTIALS = <value> for gitlab-org/gitlab-ce.
Set NPM_INSTALL_TOKEN = <value> for gitlab-org/gitlab-ce.
Completed setting variables on Gitlab CI.

Get all variables (glci getAll)

Download all variable key/value pairs to a properties file.

Run the following command:

$ glci getAll --token <gitlab-token> --url <gitlab-project-url> --output result.yml
Downloaded variables from Gitlab CI.
Saved variables to result.yml

Note that if you do not specify output, then the properties file will be saved to gitlab.env.yml in the current directory.

For all usages

--do-not-force

By default, existing variables on Gitlab CI will be overridden. If you wish to ignore existing variables, add a --do-not-force option, e.g:

$ glci setAll --token <gitlab-token> --url <gitlab-project-url> --do-not-force
Skipping AWS_CREDENTIALS, already set for gitlab-org/gitlab-ce.
Skipping NPM_INSTALL_TOKEN, already set for gitlab-org/gitlab-ce.
Completed setting variables on Gitlab CI.
--url

If your working directory is a git repository of your project, the --url option can be omitted, e.g:

$ glci set --token <gitlab-token> --key <key> --value <value>
No URL specified, using git remote `origin`.
Set <key> = <value> for gitlab-org/gitlab-ce.
Completed setting variable on Gitlab CI.

Omitting --url will derive the URL from the remote named origin.

--token

This project supports .gitlabrc files using rc. If --token is not specified, this project can use a .gitlabrc, e.g:

token = this-is-my-gitlab-token
$ glci setAll --url <gitlab-project-url>
Using token from .gitlabrc.
Set AWS_CREDENTIALS = <value> for gitlab-org/gitlab-ce.
Set NPM_INSTALL_TOKEN = <value> for gitlab-org/gitlab-ce.
Completed setting variables on Gitlab CI.

Alternatively, you can also set a GITLAB_TOKEN environment variable:

$ export GITLAB_TOKEN=this-is-my-gitlab-token
$ glci set --url <gitlab-project-url> --key <key> --value <value>
Using token from environment variable GITLAB_TOKEN.
Set <key> = <value> for gitlab-org/gitlab-ce.
Completed setting variable on Gitlab CI.

Essentially, if your project is a git repository, and you have a .gitlabrc file or a GITLAB_TOKEN env variable, this tool can be invoked simply as:

$ glci setAll
Using token from .gitlabrc.
No URL specified, using git remote `origin`.
Set AWS_CREDENTIALS = <value> for gitlab-org/gitlab-ce.
Set NPM_INSTALL_TOKEN = <value> for gitlab-org/gitlab-ce.
Completed setting variables on Gitlab CI.
$ glci set --key <key> --value <value>
Using token from environment variable GITLAB_TOKEN.
No URL specified, using git remote `origin`.
Set <key> = <value> for gitlab-org/gitlab-ce.
Completed setting variable on Gitlab CI.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].