ThaddeusJiang / gitlab_cli

GitLab's unofficial command line tool

Home Page:https://hexdocs.pm/gitlab_cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitLab CLI

GitLab's unofficial command line tool

Hex.pm version

Demo

Usage

Used in gitlab-ci.yml:

run:
  image: elixir:latest
  script:
    - mix local.hex --force
    - mix local.rebar --force
    - mix escript.install hex gitlab_cli --force
    - export PATH=$PATH:/root/.mix/escripts
    - gitlab_cli --project-id 54958131 \
      --source-branch "deploy-main" --target-branch "main" \
      --file-path "src/dev.yml" --pattern "charge-backend:.*" --content "charge-backend:${CI_COMMIT_SHA}"

Environment variables

  • GITLAB_PRIVATE_TOKEN - The GitLab private token. (required)

Parameters

  • --project-id - The GitLab project id. (required)
  • --source-branch - The source branch. (required)
  • --target-branch - The target branch. (required)
  • --file-path - The file path. (required)
  • --pattern - The pattern to search for. (required) syntax: prefix:.*
  • --content - The content to replace with. (required) syntax: prefix:new-value

Development

mix deps.get

iex -S mix

Test

mix test

Build

mix escript.build

Publish

mix test
mix docs

mix hex.publish

About

GitLab's unofficial command line tool

https://hexdocs.pm/gitlab_cli/


Languages

Language:Elixir 100.0%